diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-07 03:06:58 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-07 14:39:51 +0200 |
commit | 8017c4d8173cfe086420dc5710d631cabd03ef67 (patch) | |
tree | c2bf02641bbbf8eef2b8bf3c2c494ecb9ffe57cf /drivers/net/ethernet/faraday | |
parent | device property: move mac addr helpers to eth.c (diff) | |
download | linux-8017c4d8173cfe086420dc5710d631cabd03ef67.tar.xz 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/faraday')
-rw-r--r-- | drivers/net/ethernet/faraday/ftgmac100.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index ab9267225573..8de9c99a18fb 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -182,10 +182,8 @@ static void ftgmac100_initial_mac(struct ftgmac100 *priv) u8 mac[ETH_ALEN]; unsigned int m; unsigned int l; - void *addr; - addr = device_get_mac_address(priv->dev, mac, ETH_ALEN); - if (addr) { + if (!device_get_mac_address(priv->dev, mac, ETH_ALEN)) { eth_hw_addr_set(priv->netdev, mac); dev_info(priv->dev, "Read MAC address %pM from device tree\n", mac); |