Skip to content

Commit

Permalink
net: macb: support of_get_mac_address new ERR_PTR error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ynezz authored and claudiubeznea committed Jun 25, 2019
1 parent c387e4c commit 5b42ec4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions drivers/net/ethernet/cadence/macb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4174,15 +4174,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);
Expand Down

0 comments on commit 5b42ec4

Please sign in to comment.