Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sascha Hauer and committed by
Mark Brown
29d2daf2 c7a1a20e

+3 -7
+1 -1
Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
··· 19 19 - pinctrl-0: pin control group to be used for this controller. 20 20 - pinctrl-names: must contain a "default" entry. 21 21 - spi-num-chipselects : the number of the chipselect signals. 22 - - bus-num : the slave chip chipselect signal number. 23 22 24 23 Optional property: 25 24 - big-endian: If present the dspi device's registers are implemented 26 25 in big endian mode. 26 + - bus-num : the slave chip chipselect signal number. 27 27 28 28 Optional SPI slave node properties: 29 29 - fsl,spi-cs-sck-delay: a delay in nanoseconds between activating chip
+2 -6
drivers/spi/spi-fsl-dspi.c
··· 1108 1108 const struct regmap_config *regmap_config; 1109 1109 struct fsl_dspi_platform_data *pdata; 1110 1110 struct spi_controller *ctlr; 1111 - int ret, cs_num, bus_num; 1111 + int ret, cs_num, bus_num = -1; 1112 1112 struct fsl_dspi *dspi; 1113 1113 struct resource *res; 1114 1114 void __iomem *base; ··· 1145 1145 } 1146 1146 ctlr->num_chipselect = cs_num; 1147 1147 1148 - ret = of_property_read_u32(np, "bus-num", &bus_num); 1149 - if (ret < 0) { 1150 - dev_err(&pdev->dev, "can't get bus-num\n"); 1151 - goto out_ctlr_put; 1152 - } 1148 + of_property_read_u32(np, "bus-num", &bus_num); 1153 1149 ctlr->bus_num = bus_num; 1154 1150 1155 1151 if (of_property_read_bool(np, "spi-slave"))