summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/cadence
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2019-05-03 17:27:08 +0300
committerDavid S. Miller <davem@davemloft.net>2019-05-06 07:47:07 +0300
commit541ddc66d665f0ed9e977f40bf99bb8bbf79d9c4 (patch)
treedc6fe408021bec1ccffee9757f81894f6e7c770b /drivers/net/ethernet/cadence
parent687e3d5550c7b0e4dca0179103741a44cd3f7864 (diff)
downloadlinux-541ddc66d665f0ed9e977f40bf99bb8bbf79d9c4.tar.xz
net: macb: support of_get_mac_address new ERR_PTR error
There was NVMEM support added directly to of_get_mac_address, and it uses nvmem_get_mac_address under the hood, so we can remove it. As of_get_mac_address can now return ERR_PTR encoded error values, adjust to that as well. Signed-off-by: Petr Štetiar <ynezz@true.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cadence')
-rw-r--r--drivers/net/ethernet/cadence/macb_main.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index bd6a62f4bd7d..5d5c9d70b2be 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4137,15 +4137,13 @@ static int macb_probe(struct platform_device *pdev)
bp->rx_intr_mask |= MACB_BIT(RXUBR);
mac = of_get_mac_address(np);
- if (mac) {
+ if (PTR_ERR(mac) == -EPROBE_DEFER) {
+ err = -EPROBE_DEFER;
+ goto err_out_free_netdev;
+ } else if (!IS_ERR(mac)) {
ether_addr_copy(bp->dev->dev_addr, mac);
} else {
- err = nvmem_get_mac_address(&pdev->dev, bp->dev->dev_addr);
- if (err) {
- if (err == -EPROBE_DEFER)
- goto err_out_free_netdev;
- macb_get_hwaddr(bp);
- }
+ macb_get_hwaddr(bp);
}
err = of_get_phy_mode(np);