diff options
author | Sowjanya Komatineni <skomatineni@nvidia.com> | 2019-04-05 02:14:06 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-04-05 05:22:52 +0200 |
commit | d9088966c851ecbe820c053b347e8d565e4fa05c (patch) | |
tree | 89702c06b865e650660859645273e0448fc84221 /drivers/spi/spi-tegra114.c | |
parent | spi: tegra114: use unpacked mode for below 4 bytes (diff) | |
download | linux-d9088966c851ecbe820c053b347e8d565e4fa05c.tar.xz linux-d9088966c851ecbe820c053b347e8d565e4fa05c.zip |
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/spi/spi-tegra114.c')
-rw-r--r-- | drivers/spi/spi-tegra114.c | 4 |
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; |