net: cadence: switch to using nvmem_get_mac_address()
authorBartosz Golaszewski <[email protected]>
Fri, 30 Nov 2018 08:20:58 +0000 (09:20 +0100)
committerDavid S. Miller <[email protected]>
Mon, 3 Dec 2018 23:40:30 +0000 (15:40 -0800)
We now have a generalized helper routine to read the MAC address from
nvmem which takes struct device as argument. The nvmem subsystem will
then try device tree first before all other potential providers.

Signed-off-by: Bartosz Golaszewski <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/ethernet/cadence/macb_main.c

index 1d86b4d5645ad884b34103a45eb42c7af95f0745..d9a208f7bb4008a23cf087528f2c755f94fcbe05 100644 (file)
@@ -4055,7 +4055,7 @@ static int macb_probe(struct platform_device *pdev)
        if (mac) {
                ether_addr_copy(bp->dev->dev_addr, mac);
        } else {
-               err = of_get_nvmem_mac_address(np, bp->dev->dev_addr);
+               err = nvmem_get_mac_address(&pdev->dev, bp->dev->dev_addr);
                if (err) {
                        if (err == -EPROBE_DEFER)
                                goto err_out_free_netdev;