Re: [PATCH v2 5/5] iio: magnetometer: ak8975: Sort OF table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

On Fri, Aug 18, 2023 at 7:04 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> On Fri, Aug 18, 2023 at 05:43:15PM +0200, Geert Uytterhoeven wrote:
> > On Fri, Aug 18, 2023 at 5:35 PM Andy Shevchenko
> > <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > > On Fri, Aug 18, 2023 at 04:55:18PM +0200, Geert Uytterhoeven wrote:
> > > > On Fri, Aug 18, 2023 at 1:30 PM Andy Shevchenko
> > > > <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > > > > On Fri, Aug 18, 2023 at 08:56:00AM +0100, Biju Das wrote:
> > > > > > Sort OF table alphabetically by compatibles.
> > > > >
> > > > > > Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > > > >
> > > > > Wrong, I haven't suggested that. See comment to the previous patch.
> > > > >
> > > > > And this is definitely wrong as Geert explained already why.
> > > > > You need to fix the code that handles the ID table first.
> > > >
> > > > I retracted my own comment:
> > > > https://lore.kernel.org/r/CAMuHMdUVCS_D0SBtDBrLQbAkdt0ZUbMOca+ukdwUtnGqzUr+cA@xxxxxxxxxxxxxx
> > > >
> > > > Upon a second read, I agree my reply
> > > >
> > > >     Seems like it is, cfr. the scoring system in drivers/of/base.c
> > > >
> > > > was confusing, as it was not super clear if it was a response to the
> > > > first or the second line of your comment:
> > > >
> > > >     You mean the OF ID list must be specifically ordered?! What a nice
> > > > minefield!
> > > >     This has to be fixed somewhere else, surely.
> > > >
> > > > Conclusion: there is no issue, the scoring system handles primary
> > > > vs. fallback compatible values, irrespective of ordering.
> > >
> > > Now I'm totally confused. Previously you mentioned a couple of
> > > different APIs — one in OF, one in SoC. AFAIU the second one
> > > still needs to be fixed to follow the logic that OF does.
> > >
> > > My previous understanding was that
> > >   OF code — no issue
> > >   SoC code — the ordering is required to be correct
> >
> > Correct.
> >
> > > Can you confirm that there is no issue in that second case?
> > > And if there is none, why did you mention it?
> >
> > There is still an issue (read: you have to be careful) in the second
> > case, which does not matter here, as this driver does not use
> > soc_device_match().
> > I mentioned soc_device_match() because it is the second popular way
> > to match on OF platforms, but behaves slightly different than
> > of_match_node().
>
> Now it's clear, thanks.
> Biju, please add that to the commit message.

All of that? The only thing that matters is that OF match tables
use scoring, so order shouldn't matter.

soc_device_match() uses different tables, and is irrelevant here.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux