summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/faraday
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-07 03:07:02 +0200
committerDavid S. Miller <davem@davemloft.net>2021-10-07 14:39:51 +0200
commit894b0fb0921529928d596c155894ecae5444712f (patch)
tree4f60713328ebffc2d45cff1abfb1067ed944bd84 /drivers/net/ethernet/faraday
parentethernet: use device_get_ethdev_address() (diff)
downloadlinux-894b0fb0921529928d596c155894ecae5444712f.tar.xz
linux-894b0fb0921529928d596c155894ecae5444712f.zip
ethernet: make more use of device_get_ethdev_address()
Convert a few drivers to device_get_ethdev_address(), saving a few LoC. The check if addr is valid in netsec is superfluous, device_get_ethdev_addr() already checks that (in fwnode_get_mac_addr()). Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/faraday')
-rw-r--r--drivers/net/ethernet/faraday/ftgmac100.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 86c2986395de..97c5d70de76e 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -183,10 +183,9 @@ static void ftgmac100_initial_mac(struct ftgmac100 *priv)
unsigned int m;
unsigned int l;
- if (!device_get_mac_address(priv->dev, mac)) {
- eth_hw_addr_set(priv->netdev, mac);
+ if (!device_get_ethdev_address(priv->dev, priv->netdev)) {
dev_info(priv->dev, "Read MAC address %pM from device tree\n",
- mac);
+ priv->netdev->dev_addr);
return;
}