Thread (91 messages) 91 messages, 10 authors, 2018-10-04

[PATCH v2 14/29] net: simplify eth_platform_get_mac_address()

From: Bartosz Golaszewski <hidden>
Date: 2018-08-10 16:17:52
Also in: linux-doc, linux-i2c, linux-omap, lkml, netdev

2018-08-10 16:39 GMT+02:00 Andy Shevchenko [off-list ref]:
On Fri, Aug 10, 2018 at 11:05 AM, Bartosz Golaszewski [off-list ref] wrote:
quoted
From: Bartosz Golaszewski <redacted>

We don't need to use pci_device_to_OF_node() - we can retrieve
dev->of_node directly even for pci devices.
quoted
        struct device_node *dp;

-       if (dev_is_pci(dev))
-               dp = pci_device_to_OF_node(to_pci_dev(dev));
-       else
-               dp = dev->of_node;
-
+       dp = dev->of_node;
        addr = NULL;
        if (dp)
                addr = of_get_mac_address(dp);
Looking more at this I could even propose to change all above by

addr = device_get_mac_address(dev, mac_addr, ETH_ALEN);

Thoughts?

--
With Best Regards,
Andy Shevchenko
Indeed seems like it's even more generalized. Thanks for spotting that.

Bart
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help