From b79332ef9d61513d0ccda74a5161bb7c31851e9c Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 23 Nov 2021 19:00:32 +0200 Subject: [PATCH] spi: Fix condition in the __spi_register_driver() The recent commit 3f07657506df ("spi: deduplicate spi_match_id() in __spi_register_driver()") inadvertently inverted a condition that provokes a (harmless) warning: WARNING KERN SPI driver mtd_dataflash has no spi_device_id for atmel,at45 Restore logic to avoid such warning to be issued. Fixes: 3f07657506df ("spi: deduplicate spi_match_id() in __spi_register_driver()") Reported-by: Jon Hunter Signed-off-by: Andy Shevchenko Tested-by: Jon Hunter Link: https://lore.kernel.org/r/20211123170034.41253-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown --- drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 5bf680fcb170..8726309b3eaf 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -474,7 +474,7 @@ int __spi_register_driver(struct module *owner, struct spi_driver *sdrv) const struct spi_device_id *spi_id; spi_id = spi_match_id(sdrv->id_table, of_name); - if (!spi_id) + if (spi_id) continue; } else { if (strcmp(sdrv->driver.name, of_name) == 0)