This is a note to let you know that I've just added the patch titled spi: spidev: Make probe to fail early if a spidev compatible is used to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: spi-spidev-make-probe-to-fail-early-if-a-spidev-comp.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 925416f2cebd2b8b493c4aa670c18910b16a9825 Author: Javier Martinez Canillas <javierm@xxxxxxxxxx> Date: Tue Nov 9 23:59:20 2021 +0100 spi: spidev: Make probe to fail early if a spidev compatible is used [ Upstream commit fffc84fd87d963a2ea77a125b8a6f5a3c9f3192d ] Some Device Trees don't use a real device name in the compatible string for SPI devices nodes, abusing the fact that the spidev driver name is used to match as a fallback when a SPI device ID table is not defined. But since commit 6840615f85f6 ("spi: spidev: Add SPI ID table") a table for SPI device IDs was added to the driver breaking the assumption that these DTs were relying on. There has been a warning message for some time since commit 956b200a846e ("spi: spidev: Warn loudly if instantiated from DT as "spidev""), making quite clear that this case is not really supported by the spidev driver. Since these devices won't match anyways after the mentioned commit, there is no point to continue if an spidev compatible is used. Let's just make the driver probe to fail early. Signed-off-by: Javier Martinez Canillas <javierm@xxxxxxxxxx> Link: https://lore.kernel.org/r/20211109225920.1158920-1-javierm@xxxxxxxxxx Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Stable-dep-of: fc28d1c1fe3b ("spi: spidev: add correct compatible for Rohm BH2228FV") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 922d778df0641..75eb1c95c4a04 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -760,9 +760,10 @@ static int spidev_probe(struct spi_device *spi) * compatible string, it is a Linux implementation thing * rather than a description of the hardware. */ - WARN(spi->dev.of_node && - of_device_is_compatible(spi->dev.of_node, "spidev"), - "%pOF: buggy DT: spidev listed directly in DT\n", spi->dev.of_node); + if (spi->dev.of_node && of_device_is_compatible(spi->dev.of_node, "spidev")) { + dev_err(&spi->dev, "spidev listed directly in DT is not supported\n"); + return -EINVAL; + } spidev_probe_acpi(spi);