aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Piepho <tpiepho@impinj.com>2018-09-20 15:18:34 -0400
committerMark Brown <broonie@kernel.org>2018-10-10 08:46:54 -0400
commit605b3bec73cbd74b4ac937b580cd0b47d1300484 (patch)
tree0779d01514d4268bb580f3eca5666cde20205eb4
parent5039563e7c25eccd7fec1de6706011009d1c5665 (diff)
spi: spidev: Fix OF tree warning logic
spidev will make a big fuss if a device tree node binds a device by using "spidev" as the node's compatible property. However, the logic for this isn't looking for "spidev" in the compatible, but rather checking that the device is NOT compatible with spidev's list of devices. This causes a false positive if a device not named "rohm,dh2228fv", etc. binds to spidev, even if a means other than putting "spidev" in the device tree was used. E.g., the sysfs driver_override attribute. Signed-off-by: Trent Piepho <tpiepho@impinj.com> Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz> Tested-by: Jan Kundrát <jan.kundrat@cesnet.cz> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spidev.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 07f4d05563ea..b0c76e2626ce 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -725,11 +725,9 @@ static int spidev_probe(struct spi_device *spi)
725 * compatible string, it is a Linux implementation thing 725 * compatible string, it is a Linux implementation thing
726 * rather than a description of the hardware. 726 * rather than a description of the hardware.
727 */ 727 */
728 if (spi->dev.of_node && !of_match_device(spidev_dt_ids, &spi->dev)) { 728 WARN(spi->dev.of_node &&
729 dev_err(&spi->dev, "buggy DT: spidev listed directly in DT\n"); 729 of_device_is_compatible(spi->dev.of_node, "spidev"),
730 WARN_ON(spi->dev.of_node && 730 "%pOF: buggy DT: spidev listed directly in DT\n", spi->dev.of_node);
731 !of_match_device(spidev_dt_ids, &spi->dev));
732 }
733 731
734 spidev_probe_acpi(spi); 732 spidev_probe_acpi(spi);
735 733