summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-altera-dfl.c
diff options
context:
space:
mode:
authorRuss Weight <russell.h.weight@intel.com>2021-10-19 03:24:01 +0300
committerMark Brown <broonie@kernel.org>2021-10-20 03:53:15 +0300
commitf09f6dfef8ce7b70a240cf83811e2b1909c3e47b (patch)
treec97113fc454cfb511ff126c0197cf83df06a9c89 /drivers/spi/spi-altera-dfl.c
parent16a8e2fbb2d49111004efc1c7342e083eafabeb0 (diff)
downloadlinux-f09f6dfef8ce7b70a240cf83811e2b1909c3e47b.tar.xz
spi: altera: Change to dynamic allocation of spi id
The spi-altera driver has two flavors: platform and dfl. I'm seeing a case where I have both device types in the same machine, and they are conflicting on the SPI ID: ... kernel: couldn't get idr ... kernel: WARNING: CPU: 28 PID: 912 at drivers/spi/spi.c:2920 spi_register_controller.cold+0x84/0xc0a Both the platform and dfl drivers use the parent's driver ID as the SPI ID. In the error case, the parent devices are dfl_dev.4 and subdev_spi_altera.4.auto. When the second spi-master is created, the failure occurs because the SPI ID of 4 has already been allocated. Change the ID allocation to dynamic (by initializing bus_num to -1) to avoid duplicate SPI IDs. Signed-off-by: Russ Weight <russell.h.weight@intel.com> Link: https://lore.kernel.org/r/20211019002401.24041-1-russell.h.weight@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-altera-dfl.c')
-rw-r--r--drivers/spi/spi-altera-dfl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-altera-dfl.c b/drivers/spi/spi-altera-dfl.c
index 44fc9ee13fc7..ca40923258af 100644
--- a/drivers/spi/spi-altera-dfl.c
+++ b/drivers/spi/spi-altera-dfl.c
@@ -134,7 +134,7 @@ static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)
if (!master)
return -ENOMEM;
- master->bus_num = dfl_dev->id;
+ master->bus_num = -1;
hw = spi_master_get_devdata(master);