diff options
author | Jon Lin <jon.lin@rock-chips.com> | 2022-02-16 09:40:23 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-02-17 15:33:17 +0000 |
commit | 9382df0a98aad5bbcd4d634790305a1d786ad224 (patch) | |
tree | b533e6d532ec4074b79835558c6e3ca394209100 /drivers/spi/spi-rockchip.c | |
parent | ab3824427b848da10e9fe2727f035bbeecae6ff4 (diff) | |
download | linux-9382df0a98aad5bbcd4d634790305a1d786ad224.tar.bz2 |
spi: rockchip: Fix error in getting num-cs property
Get num-cs u32 from dts of_node property rather than u16.
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Link: https://lore.kernel.org/r/20220216014028.8123-2-jon.lin@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-rockchip.c')
-rw-r--r-- | drivers/spi/spi-rockchip.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 553b6b9d0222..4f65ba3dd19c 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -654,7 +654,7 @@ static int rockchip_spi_probe(struct platform_device *pdev) struct spi_controller *ctlr; struct resource *mem; struct device_node *np = pdev->dev.of_node; - u32 rsd_nsecs; + u32 rsd_nsecs, num_cs; bool slave_mode; slave_mode = of_property_read_bool(np, "spi-slave"); @@ -764,8 +764,9 @@ static int rockchip_spi_probe(struct platform_device *pdev) * rk spi0 has two native cs, spi1..5 one cs only * if num-cs is missing in the dts, default to 1 */ - if (of_property_read_u16(np, "num-cs", &ctlr->num_chipselect)) - ctlr->num_chipselect = 1; + if (of_property_read_u32(np, "num-cs", &num_cs)) + num_cs = 1; + ctlr->num_chipselect = num_cs; ctlr->use_gpio_descriptors = true; } ctlr->dev.of_node = pdev->dev.of_node; |