Skip to content

Commit 0f11a77

Browse files
ynezzclaudiubeznea
authored andcommitted
net: davinci: 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> [claudiu.beznea@microchip.com: adapt to 4.19] Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
1 parent 78ddc03 commit 0f11a77

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/net/ethernet/ti/davinci_emac.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
17141714

17151715
if (!is_valid_ether_addr(pdata->mac_addr)) {
17161716
mac_addr = of_get_mac_address(np);
1717-
if (mac_addr)
1717+
if (!IS_ERR(mac_addr))
17181718
ether_addr_copy(pdata->mac_addr, mac_addr);
17191719
}
17201720

@@ -1912,11 +1912,11 @@ static int davinci_emac_probe(struct platform_device *pdev)
19121912
ether_addr_copy(ndev->dev_addr, priv->mac_addr);
19131913

19141914
if (!is_valid_ether_addr(priv->mac_addr)) {
1915-
/* Use random MAC if none passed */
1915+
/* Use random MAC if still none obtained. */
19161916
eth_hw_addr_random(ndev);
19171917
memcpy(priv->mac_addr, ndev->dev_addr, ndev->addr_len);
19181918
dev_warn(&pdev->dev, "using random MAC addr: %pM\n",
1919-
priv->mac_addr);
1919+
priv->mac_addr);
19201920
}
19211921

19221922
ndev->netdev_ops = &emac_netdev_ops;

0 commit comments

Comments
 (0)