]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
enc28j60: Use device_get_mac_address()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 19 Mar 2019 18:49:18 +0000 (20:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Mar 2019 21:59:31 +0000 (14:59 -0700)
Replace the DT-specific of_get_mac_address() function with
device_get_mac_address, which works on both DT and ACPI platforms.
This change makes it easier to add ACPI support.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/microchip/enc28j60.c

index 8f72587b5a2cbb9c79b8d0377d779650eccb7446..559f62ef2598932b97957b1846cf085478762a14 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/interrupt.h>
+#include <linux/property.h>
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -28,7 +29,6 @@
 #include <linux/skbuff.h>
 #include <linux/delay.h>
 #include <linux/spi/spi.h>
-#include <linux/of_net.h>
 
 #include "enc28j60_hw.h"
 
@@ -1552,9 +1552,9 @@ static const struct net_device_ops enc28j60_netdev_ops = {
 
 static int enc28j60_probe(struct spi_device *spi)
 {
+       unsigned char macaddr[ETH_ALEN];
        struct net_device *dev;
        struct enc28j60_net *priv;
-       const void *macaddr;
        int ret = 0;
 
        if (netif_msg_drv(&debug))
@@ -1587,8 +1587,7 @@ static int enc28j60_probe(struct spi_device *spi)
                goto error_irq;
        }
 
-       macaddr = of_get_mac_address(spi->dev.of_node);
-       if (macaddr)
+       if (device_get_mac_address(&spi->dev, macaddr, sizeof(macaddr)))
                ether_addr_copy(dev->dev_addr, macaddr);
        else
                eth_hw_addr_random(dev);