spi: Fix condition in the __spi_register_driver()

The recent commit 3f07657506 ("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: 3f07657506 ("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>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20211123170034.41253-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Andy Shevchenko 2021-11-23 19:00:32 +02:00 committed by Mark Brown
parent fffc84fd87
commit b79332ef9d
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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)