summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/qualcomm/emac
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-07 04:07:02 +0300
committerDavid S. Miller <davem@davemloft.net>2021-10-07 15:39:51 +0300
commit894b0fb0921529928d596c155894ecae5444712f (patch)
tree4f60713328ebffc2d45cff1abfb1067ed944bd84 /drivers/net/ethernet/qualcomm/emac
parentb8eeac565b162b6a00423a5d9ed2d1284342bdfd (diff)
downloadlinux-894b0fb0921529928d596c155894ecae5444712f.tar.xz
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/qualcomm/emac')
-rw-r--r--drivers/net/ethernet/qualcomm/emac/emac.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c
index b1b324f45fe7..a55c52696d49 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac.c
@@ -545,13 +545,10 @@ static int emac_probe_resources(struct platform_device *pdev,
struct emac_adapter *adpt)
{
struct net_device *netdev = adpt->netdev;
- char maddr[ETH_ALEN];
int ret = 0;
/* get mac address */
- if (!device_get_mac_address(&pdev->dev, maddr))
- eth_hw_addr_set(netdev, maddr);
- else
+ if (device_get_ethdev_address(&pdev->dev, netdev))
eth_hw_addr_random(netdev);
/* Core 0 interrupt */