summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-xilinx.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-07-10 12:30:20 +0400
committerMark Brown <broonie@linaro.org>2014-07-10 14:38:45 +0400
commit4b153a2137c5d2914794c8944d78c731c1b0ae9d (patch)
tree681bf3d71076ec7cd50c22211c4a80145b0c6836 /drivers/spi/spi-xilinx.c
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
downloadlinux-4b153a2137c5d2914794c8944d78c731c1b0ae9d.tar.xz
spi: xilinx: Use pdev->id instead of pdev->dev.id for the SPI bus number
The Xilinx SPI driver initializes the bus_num field of the SPI master to pdev->dev.id. pdev->dev.id is always 0 for platform devices which causes bus number conflicts for the SPI controller when creating multiple device instances of the driver. Instead use pdev->id which will have the assignt platform device id. If the device is instantiated via devicetree pdev->id is -1 which will cause the SPI core to dynamically assign a id (or use the id defined via a alias in the devicetree). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-xilinx.c')
-rw-r--r--drivers/spi/spi-xilinx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index a3b0b9944bf0..4d8efb16573d 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -369,7 +369,7 @@ static int xilinx_spi_probe(struct platform_device *pdev)
goto put_master;
}
- master->bus_num = pdev->dev.id;
+ master->bus_num = pdev->id;
master->num_chipselect = num_cs;
master->dev.of_node = pdev->dev.of_node;