linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/3] spi: Fix condition in the __spi_register_driver()
@ 2021-11-23 17:00 Andy Shevchenko
  2021-11-23 17:00 ` [PATCH v3 2/3] spi: Replace memset() with __GFP_ZERO Andy Shevchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Andy Shevchenko @ 2021-11-23 17:00 UTC (permalink / raw)
  To: Mark Brown, linux-spi, linux-kernel; +Cc: Andy Shevchenko, Jon Hunter

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 <jonathanh@nvidia.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v3: a fix-patch instead of previously applied one (Jon)
 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 9d19d9bae253..15688acc952c 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)
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-24 17:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 17:00 [PATCH v3 1/3] spi: Fix condition in the __spi_register_driver() Andy Shevchenko
2021-11-23 17:00 ` [PATCH v3 2/3] spi: Replace memset() with __GFP_ZERO Andy Shevchenko
2021-11-23 17:02   ` Andy Shevchenko
2021-11-23 17:00 ` [PATCH v3 3/3] spi: Fix multi-line comment style Andy Shevchenko
2021-11-23 17:02   ` Andy Shevchenko
2021-11-23 17:34 ` [PATCH v3 1/3] spi: Fix condition in the __spi_register_driver() Jon Hunter
2021-11-24 17:37 ` (subset) " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).