lkml.org 
[lkml]   [2021]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v1 1/2] spi: deduplicate spi_match_id() in __spi_register_driver()
On Tue, Nov 23, 2021 at 03:22:38PM +0000, Jon Hunter wrote:
> On 19/11/2021 17:37, Andy Shevchenko wrote:

> > @@ -474,12 +473,8 @@ int __spi_register_driver(struct module *owner, struct spi_driver *sdrv)
> > if (sdrv->id_table) {
> > const struct spi_device_id *spi_id;
> > - for (spi_id = sdrv->id_table; spi_id->name[0];
> > - spi_id++)
> > - if (strcmp(spi_id->name, of_name) == 0)
> > - break;

> > - if (spi_id->name[0])
> > + spi_id = spi_match_id(sdrv->id_table, of_name);
> > + if (!spi_id)

Seems I have inverted condition here. Shouldn't it be

if (spi_id)

instead?

> > continue;
> > } else {
> > if (strcmp(sdrv->driver.name, of_name) == 0)
> >
>
>
> Following this change I am seeing the following warnings again although most
> of these have now been fixed ...
>
> WARNING KERN SPI driver mtd_dataflash has no spi_device_id for atmel,at45
> WARNING KERN SPI driver mtd_dataflash has no spi_device_id for
> atmel,dataflash
> WARNING KERN SPI driver spi-nor has no spi_device_id for jedec,spi-nor
> WARNING KERN SPI driver mmc_spi has no spi_device_id for mmc-spi-slot
> WARNING KERN SPI driver cros-ec-spi has no spi_device_id for
> google,cros-ec-spi
>
> I have not looked any further yet, but this appears to cause the SPI ID
> match to fail.

Ah, thanks for testing!
Can you try above?

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2021-11-23 16:44    [W:0.098 / U:0.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site