Skip to content

Commit 185666e

Browse files
andy-shevclaudiubeznea
authored andcommitted
enc28j60: Use device_get_mac_address()
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>
1 parent 1af8705 commit 185666e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/net/ethernet/microchip/enc28j60.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/types.h>
1919
#include <linux/fcntl.h>
2020
#include <linux/interrupt.h>
21+
#include <linux/property.h>
2122
#include <linux/string.h>
2223
#include <linux/errno.h>
2324
#include <linux/init.h>
@@ -28,7 +29,6 @@
2829
#include <linux/skbuff.h>
2930
#include <linux/delay.h>
3031
#include <linux/spi/spi.h>
31-
#include <linux/of_net.h>
3232

3333
#include "enc28j60_hw.h"
3434

@@ -1552,9 +1552,9 @@ static const struct net_device_ops enc28j60_netdev_ops = {
15521552

15531553
static int enc28j60_probe(struct spi_device *spi)
15541554
{
1555+
unsigned char macaddr[ETH_ALEN];
15551556
struct net_device *dev;
15561557
struct enc28j60_net *priv;
1557-
const void *macaddr;
15581558
int ret = 0;
15591559

15601560
if (netif_msg_drv(&debug))
@@ -1587,8 +1587,7 @@ static int enc28j60_probe(struct spi_device *spi)
15871587
goto error_irq;
15881588
}
15891589

1590-
macaddr = of_get_mac_address(spi->dev.of_node);
1591-
if (macaddr)
1590+
if (device_get_mac_address(&spi->dev, macaddr, sizeof(macaddr)))
15921591
ether_addr_copy(dev->dev_addr, macaddr);
15931592
else
15941593
eth_hw_addr_random(dev);

0 commit comments

Comments
 (0)