Thread (84 messages) 84 messages, 9 authors, 2022-06-25

Re: [net-next: PATCH 05/12] net: core: switch to fwnode_find_net_device_by_node()

From: Marcin Wojtas <hidden>
Date: 2022-06-20 23:20:48
Also in: linux-acpi, lkml

pon., 20 cze 2022 o 19:46 Andy Shevchenko
[off-list ref] napisał(a):
On Mon, Jun 20, 2022 at 05:02:18PM +0200, Marcin Wojtas wrote:
quoted
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.
...
quoted
+static int fwnode_dev_node_match(struct device *dev, const void *data)
 {
      for (; dev; dev = dev->parent) {
-             if (dev->of_node == data)
quoted
+             if (dev->fwnode == data)

We have a helper in device/bus.h (?) device_match_fwnode().
That's true, thanks.
quoted
                      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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help