[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220727143147.u6yd6wqslilspyhw@skbuf>
Date: Wed, 27 Jul 2022 17:31:47 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Marcin Wojtas <mw@...ihalf.com>
Cc: linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
netdev@...r.kernel.org, rafael@...nel.org,
andriy.shevchenko@...ux.intel.com, sean.wang@...iatek.com,
Landen.Chao@...iatek.com, linus.walleij@...aro.org, andrew@...n.ch,
vivien.didelot@...il.com, f.fainelli@...il.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, linux@...linux.org.uk, hkallweit1@...il.com,
gjb@...ihalf.com, jaz@...ihalf.com, tn@...ihalf.com,
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()
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.
> 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