[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPv3WKc88KQN=athEqBg=Z5Bd1SC3QSOPZpDH7dfuYGHhR+oVg@mail.gmail.com>
Date: Wed, 27 Jul 2022 17:18:16 +0200
From: Marcin Wojtas <mw@...ihalf.com>
To: Vladimir Oltean <olteanv@...il.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>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Sean Wang <sean.wang@...iatek.com>,
Landen Chao <Landen.Chao@...iatek.com>,
Linus Walleij <linus.walleij@...aro.org>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <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 v3 6/8] net: core: switch to fwnode_find_net_device_by_node()
śr., 27 lip 2022 o 16:31 Vladimir Oltean <olteanv@...il.com> napisał(a):
>
> On Wed, Jul 27, 2022 at 08:43:19AM +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.
> > For that purpose use newly added fwnode_dev_node_match helper routine.
> >
> > Signed-off-by: Marcin Wojtas <mw@...ihalf.com>
> > ---
> > -struct net_device *of_find_net_device_by_node(struct device_node *np)
> > +struct net_device *fwnode_find_net_device_by_node(struct fwnode_handle *fwnode)
> > {
> > struct device *dev;
> >
> > - dev = class_find_device(&net_class, NULL, np, of_dev_node_match);
> > + dev = class_find_device(&net_class, NULL, fwnode, fwnode_find_parent_dev_match);
>
> This needs to maintain compatibility with DSA masters that have
> dev->of_node but don't have dev->fwnode populated.
>
Do you mean a situation analogous to what I addressed in:
[net-next: PATCH v3 4/8] net: mvpp2: initialize port fwnode pointer
?
I found indeed a couple of drivers that may require a similar change
(e.g. dpaa2).
IMO we have 2 options:
- update these drivers
- add some kind of fallback? If yes, I am wondering about an elegant
solution - maybe add an extra check inside
fwnode_find_parent_dev_match?
What would you suggest?
Best regards,
Marcin
> > if (!dev)
> > return NULL;
> >
> > return to_net_dev(dev);
> > }
> > -EXPORT_SYMBOL(of_find_net_device_by_node);
> > -#endif
> > +EXPORT_SYMBOL(fwnode_find_net_device_by_node);
Powered by blists - more mailing lists