Unverified Commit b79332ef authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown
Browse files

spi: Fix condition in the __spi_register_driver()



The recent commit 3f076575 ("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: 3f076575 ("spi: deduplicate spi_match_id() in __spi_register_driver()")
Reported-by: default avatarJon Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarJon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20211123170034.41253-1-andriy.shevchenko@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent fffc84fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)