diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-03-05 14:55:46 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-03-05 17:36:25 +0300 |
commit | 29d2daf2c33ce9b1038f3fcd55e16a788c00fc86 (patch) | |
tree | 3385c9dd66e654c96f62c067c2a35133993e5152 /drivers/spi/spi-fsl-dspi.c | |
parent | c7a1a20e36faed2a298dd2965ab91c31dfc43f73 (diff) | |
download | linux-29d2daf2c33ce9b1038f3fcd55e16a788c00fc86.tar.xz |
spi: spi-fsl-dspi: Make bus-num property optional
The SPI bus number is completely optional to Linux, so make the
corresponding device tree property optional as well.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20200305115546.31814-1-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-fsl-dspi.c')
-rw-r--r-- | drivers/spi/spi-fsl-dspi.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index c357c3247232..74dc0df518fa 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -1108,7 +1108,7 @@ static int dspi_probe(struct platform_device *pdev) const struct regmap_config *regmap_config; struct fsl_dspi_platform_data *pdata; struct spi_controller *ctlr; - int ret, cs_num, bus_num; + int ret, cs_num, bus_num = -1; struct fsl_dspi *dspi; struct resource *res; void __iomem *base; @@ -1145,11 +1145,7 @@ static int dspi_probe(struct platform_device *pdev) } ctlr->num_chipselect = cs_num; - ret = of_property_read_u32(np, "bus-num", &bus_num); - if (ret < 0) { - dev_err(&pdev->dev, "can't get bus-num\n"); - goto out_ctlr_put; - } + of_property_read_u32(np, "bus-num", &bus_num); ctlr->bus_num = bus_num; if (of_property_read_bool(np, "spi-slave")) |