linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jon Hunter <jonathanh@nvidia.com>
Cc: Mark Brown <broonie@kernel.org>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH v1 1/2] spi: deduplicate spi_match_id() in __spi_register_driver()
Date: Tue, 23 Nov 2021 17:43:20 +0200	[thread overview]
Message-ID: <YZ0MGP0HDjLN/HfD@smile.fi.intel.com> (raw)
In-Reply-To: <1572a2ff-dcfb-422f-c4c3-5a454a36d31d@nvidia.com>

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



  reply	other threads:[~2021-11-23 15:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 17:37 [PATCH v1 1/2] spi: deduplicate spi_match_id() in __spi_register_driver() Andy Shevchenko
2021-11-19 17:37 ` [PATCH v1 2/2] spi: Fix multi-line comment style Andy Shevchenko
2021-11-22 15:47   ` Mark Brown
2021-11-22 17:09     ` Andy Shevchenko
2021-11-22 17:15       ` Andy Shevchenko
2021-11-23  0:00 ` [PATCH v1 1/2] spi: deduplicate spi_match_id() in __spi_register_driver() Mark Brown
2021-11-23 15:22 ` Jon Hunter
2021-11-23 15:43   ` Andy Shevchenko [this message]
2021-11-23 16:51   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YZ0MGP0HDjLN/HfD@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).