summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSowjanya Komatineni <skomatineni@nvidia.com>2019-04-04 17:14:06 -0700
committerMark Brown <broonie@kernel.org>2019-04-05 10:22:52 +0700
commitd9088966c851ecbe820c053b347e8d565e4fa05c (patch)
tree89702c06b865e650660859645273e0448fc84221 /drivers
parent76457eea24db3c7d51f623c08838bbffda6ac3ad (diff)
downloadlinux-d9088966c851ecbe820c053b347e8d565e4fa05c.tar.bz2
spi: tegra114: set bus number based on id
This patch sets SPI device id from the device tree as the bus number. Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/spi-tegra114.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index ea67ff3b5b2c..402799c7f6b7 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -1137,6 +1137,7 @@ static int tegra_spi_probe(struct platform_device *pdev)
struct tegra_spi_data *tspi;
struct resource *r;
int ret, spi_irq;
+ int bus_num;
master = spi_alloc_master(&pdev->dev, sizeof(*tspi));
if (!master) {
@@ -1157,6 +1158,9 @@ static int tegra_spi_probe(struct platform_device *pdev)
master->transfer_one_message = tegra_spi_transfer_one_message;
master->num_chipselect = MAX_CHIP_SELECT;
master->auto_runtime_pm = true;
+ bus_num = of_alias_get_id(pdev->dev.of_node, "spi");
+ if (bus_num >= 0)
+ master->bus_num = bus_num;
tspi->master = master;
tspi->dev = &pdev->dev;