[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190228203435.88702-1-andriy.shevchenko@linux.intel.com>
Date: Thu, 28 Feb 2019 23:34:29 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v1 1/7] 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@...ux.intel.com>
---
drivers/net/ethernet/microchip/enc28j60.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/microchip/enc28j60.c b/drivers/net/ethernet/microchip/enc28j60.c
index 8f72587b5a2c..fa6d37c86315 100644
--- a/drivers/net/ethernet/microchip/enc28j60.c
+++ b/drivers/net/ethernet/microchip/enc28j60.c
@@ -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"
@@ -1554,7 +1554,7 @@ static int enc28j60_probe(struct spi_device *spi)
{
struct net_device *dev;
struct enc28j60_net *priv;
- const void *macaddr;
+ unsigned char macaddr[ETH_ALEN];
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);
--
2.20.1
Powered by blists - more mailing lists