diff options
author | 2021-10-06 18:06:58 -0700 | |
---|---|---|
committer | 2021-10-07 13:39:51 +0100 | |
commit | 8017c4d8173cfe086420dc5710d631cabd03ef67 (patch) | |
tree | c2bf02641bbbf8eef2b8bf3c2c494ecb9ffe57cf /drivers/net/ethernet/socionext | |
parent | device property: move mac addr helpers to eth.c (diff) | |
download | linux-8017c4d8173cfe086420dc5710d631cabd03ef67.tar.gz linux-8017c4d8173cfe086420dc5710d631cabd03ef67.tar.bz2 linux-8017c4d8173cfe086420dc5710d631cabd03ef67.zip |
eth: fwnode: change the return type of mac address helpers
fwnode_get_mac_address() and device_get_mac_address()
return a pointer to the buffer that was passed to them
on success or NULL on failure. None of the callers
care about the actual value, only if it's NULL or not.
These semantics differ from of_get_mac_address() which
returns an int so to avoid confusion make the device
helpers return an errno.
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 | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index c7e56dc0a494..f8dd7fa5f632 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -1978,10 +1978,10 @@ static int netsec_register_mdio(struct netsec_priv *priv, u32 phy_addr) static int netsec_probe(struct platform_device *pdev) { struct resource *mmio_res, *eeprom_res, *irq_res; - u8 *mac, macbuf[ETH_ALEN]; 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 +2034,12 @@ static int netsec_probe(struct platform_device *pdev) goto free_ndev; } - mac = device_get_mac_address(&pdev->dev, macbuf, sizeof(macbuf)); - if (mac) - eth_hw_addr_set(ndev, mac); + ret = device_get_mac_address(&pdev->dev, macbuf, sizeof(macbuf)); + if (!ret) + eth_hw_addr_set(ndev, macbuf); if (priv->eeprom_base && - (!mac || !is_valid_ether_addr(ndev->dev_addr))) { + (ret || !is_valid_ether_addr(ndev->dev_addr))) { void __iomem *macp = priv->eeprom_base + NETSEC_EEPROM_MAC_ADDRESS; |