[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPv3WKcscyUdoTpf1KS_fsS7G0oPr-WqMMAHdJ_T550J0X2LeA@mail.gmail.com>
Date: Tue, 21 Jun 2022 01:15:45 +0200
From: Marcin Wojtas <mw@...ihalf.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
netdev <netdev@...r.kernel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>, Andrew Lunn <andrew@...n.ch>,
vivien.didelot@...il.com, Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, pabeni@...hat.com,
Russell King - ARM Linux <linux@...linux.org.uk>,
Heiner Kallweit <hkallweit1@...il.com>,
Grzegorz Bernacki <gjb@...ihalf.com>,
Grzegorz Jaszczyk <jaz@...ihalf.com>,
Tomasz Nowicki <tn@...ihalf.com>,
Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@....com>,
upstream@...ihalf.com
Subject: Re: [net-next: PATCH 05/12] net: core: switch to fwnode_find_net_device_by_node()
pon., 20 cze 2022 o 19:46 Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> napisaĆ(a):
>
> On Mon, Jun 20, 2022 at 05:02:18PM +0200, Marcin Wojtas wrote:
> > A helper function which allows getting the struct net_device pointer
> > associated with a given device tree node can be more generic and
> > also support alternative hardware description. Switch to fwnode_
> > and update the only existing caller in DSA subsystem.
>
> ...
>
> > +static int fwnode_dev_node_match(struct device *dev, const void *data)
> > {
> > for (; dev; dev = dev->parent) {
> > - if (dev->of_node == data)
>
> > + if (dev->fwnode == data)
>
>
> We have a helper in device/bus.h (?) device_match_fwnode().
>
That's true, thanks.
> > return 1;
> > }
>
> But this all sounds like a good candidate to be generic. Do we have more users
> in the kernel of a such?
>
Do you mean fwnode_dev_node_match? I haven't noticed. Indeed, it may
be worth to move this one to drivers/base/property.c - what do you
think?
Thanks,
Marcin
Powered by blists - more mailing lists