Populate netdev of_node with pdev of_node so that the network device
inherits the device tree node information from the platform device and
its of_node is available in sysfs.
Without this, udev is unable to expose the OF_* properties (OF_NAME,
OF_FULLNAME, OF_COMPATIBLE, OF_ALIAS, etc.) for the network interface.
These properties are commonly used by udev rules and other userspace
tools for device identification and configuration.
Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
---
drivers/net/ethernet/freescale/fec_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 63dac4272045..5142fed08cba 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -4359,6 +4359,7 @@ fec_probe(struct platform_device *pdev)
return -ENOMEM;
SET_NETDEV_DEV(ndev, &pdev->dev);
+ ndev->dev.of_node = pdev->dev.of_node;
/* setup board info structure */
fep = netdev_priv(ndev);
--
2.34.1
On Thu, Jul 17, 2025 at 11:00:36AM +0200, Primoz Fiser wrote: >Populate netdev of_node with pdev of_node so that the network device >inherits the device tree node information from the platform device and >its of_node is available in sysfs. > >Without this, udev is unable to expose the OF_* properties (OF_NAME, >OF_FULLNAME, OF_COMPATIBLE, OF_ALIAS, etc.) for the network interface. >These properties are commonly used by udev rules and other userspace >tools for device identification and configuration. > >Signed-off-by: Primoz Fiser <primoz.fiser@norik.com> >--- > drivers/net/ethernet/freescale/fec_main.c | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c >index 63dac4272045..5142fed08cba 100644 >--- a/drivers/net/ethernet/freescale/fec_main.c >+++ b/drivers/net/ethernet/freescale/fec_main.c >@@ -4359,6 +4359,7 @@ fec_probe(struct platform_device *pdev) > return -ENOMEM; > > SET_NETDEV_DEV(ndev, &pdev->dev); >+ ndev->dev.of_node = pdev->dev.of_node; You may need to use device_set_of_node_from_dev. Regards, Peng > > /* setup board info structure */ > fep = netdev_priv(ndev); >-- >2.34.1 >
© 2016 - 2025 Red Hat, Inc.