diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-06 18:07:02 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-07 13:39:51 +0100 |
commit | 894b0fb0921529928d596c155894ecae5444712f (patch) | |
tree | 4f60713328ebffc2d45cff1abfb1067ed944bd84 /drivers/net/ethernet/socionext | |
parent | b8eeac565b162b6a00423a5d9ed2d1284342bdfd (diff) |
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/socionext')
-rw-r--r-- | drivers/net/ethernet/socionext/netsec.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index 7e3dd07ac94e..baa9f5d1c549 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -1981,7 +1981,6 @@ static int netsec_probe(struct platform_device *pdev) struct netsec_priv *priv; u32 hw_ver, phy_addr = 0; struct net_device *ndev; - u8 macbuf[ETH_ALEN]; int ret; mmio_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -2034,12 +2033,8 @@ static int netsec_probe(struct platform_device *pdev) goto free_ndev; } - ret = device_get_mac_address(&pdev->dev, macbuf); - if (!ret) - eth_hw_addr_set(ndev, macbuf); - - if (priv->eeprom_base && - (ret || !is_valid_ether_addr(ndev->dev_addr))) { + ret = device_get_ethdev_address(&pdev->dev, ndev); + if (ret && priv->eeprom_base) { void __iomem *macp = priv->eeprom_base + NETSEC_EEPROM_MAC_ADDRESS; |