]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spidev: Make probe to fail early if a spidev compatible is used
authorJavier Martinez Canillas <javierm@redhat.com>
Tue, 9 Nov 2021 22:59:20 +0000 (23:59 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 24 Nov 2021 12:57:40 +0000 (12:57 +0000)
commit9d834ffa0df6ad09711e0ba156925c956e4bed38
tree5da091e36e284b524d7e81eda084b51499343859
parent3108c1b0b2cee4889c03d909ea7f0329ef138c95
spi: spidev: Make probe to fail early if a spidev compatible is used

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 017fdd119780 ("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 1e496dfbe8f6
("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@redhat.com>
Link: https://lore.kernel.org/r/20211109225920.1158920-1-javierm@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spidev.c