Skip to content

Commit

Permalink
spi: tegra114: set bus number based on id
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sowjanya Komatineni authored and Mark Brown committed Apr 5, 2019
1 parent 76457ee commit d908896
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/spi/spi-tegra114.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit d908896

Please sign in to comment.