]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
spi: Fix SPI slave probe failure
authorAmit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Mon, 17 Jun 2024 15:30:52 +0000 (21:00 +0530)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Fri, 2 Aug 2024 14:27:29 +0000 (16:27 +0200)
commit935a674bf30e3c3bc479c8e6cd3506f4969f08aa
tree6b418cfed97232b1bf9c33d82a3255f1623f5e4e
parentc0d23820d3dc1155a31fbbc40b163f978b54823f
spi: Fix SPI slave probe failure

BugLink: https://bugs.launchpad.net/bugs/2075154
[ Upstream commit 2c1b7bbe253986619fa5623a13055316e730e746 ]

While adding a SPI device, the SPI core ensures that multiple logical CS
doesn't map to the same physical CS. For example, spi->chip_select[0] !=
spi->chip_select[1] and so forth. However, unlike the SPI master, the SPI
slave doesn't have the list of chip selects, this leads to probe failure
when the SPI controller is configured as slave. Update the
__spi_add_device() function to perform this check only if the SPI
controller is configured as master.

Fixes: 4d8ff6b0991d ("spi: Add multi-cs memories support in SPI core")
Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Link: https://msgid.link/r/20240617153052.26636-1-amit.kumar-mahapatra@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/spi/spi.c