netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 01/13] enc28j60: Use device_get_mac_address()
@ 2019-03-18 16:10 Andy Shevchenko
  2019-03-18 16:10 ` [PATCH v2 02/13] enc28j60: Remove duplicate messaging Andy Shevchenko
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-03-18 16:10 UTC (permalink / raw)
  To: David S. Miller, netdev; +Cc: Andy Shevchenko

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>
---
 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..559f62ef2598 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"
 
@@ -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);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread
* [PATCH v2 00/13] enc28j60: messaging clean up and ACPI improvements
@ 2019-03-19 18:49 Andy Shevchenko
  2019-03-19 18:49 ` [PATCH v2 13/13] enc28j60: Convert to use SPDX identifier Andy Shevchenko
  0 siblings, 1 reply; 18+ messages in thread
From: Andy Shevchenko @ 2019-03-19 18:49 UTC (permalink / raw)
  To: David S. Miller, netdev; +Cc: Andy Shevchenko

Most of the patches in the series dedicated to update messaging to use modern
APIs, such as netdev, with a benefit to distinguish devices, if more than one
installed on the system.

Besides that, patch 1 targeting ACPI enabled systems when MAC address provided
there via properties.

And few clean ups are included, such as:
- switching to module_spi_driver()
- converting to use ether_addr_copy() API
- converting to use SPDX

Since v2:
- cover letter is added

Andy Shevchenko (13):
  enc28j60: Use device_get_mac_address()
  enc28j60: Remove duplicate messaging
  enc28j60: Replace dev_*(&netdev->dev, ...) with netdev_*()
  enc28j60: Drop driver name duplication from messages
  enc28j60: Switch to use module_spi_driver() macro
  enc28j60: Use ether_addr_copy() in enc28j60_set_mac_address()
  enc28j60: Switch to dev_<level> from pr_<level>
  enc28j60: Convert HW related printk() to dev_printk()
  enc28j60: Convert printk() to netdev_printk()
  enc28j60: Remove linux/init.h
  enc28j60: Amend comments by fixing typos, adding periods, etc
  enc28j60: Fix indentation splats
  enc28j60: Convert to use SPDX identifier

 drivers/net/ethernet/microchip/enc28j60.c | 541 ++++++++++------------
 1 file changed, 253 insertions(+), 288 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-03-19 18:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-18 16:10 [PATCH v2 01/13] enc28j60: Use device_get_mac_address() Andy Shevchenko
2019-03-18 16:10 ` [PATCH v2 02/13] enc28j60: Remove duplicate messaging Andy Shevchenko
2019-03-18 16:10 ` [PATCH v2 03/13] enc28j60: Replace dev_*(&netdev->dev, ...) with netdev_*() Andy Shevchenko
2019-03-18 16:10 ` [PATCH v2 04/13] enc28j60: Drop driver name duplication from messages Andy Shevchenko
2019-03-18 16:10 ` [PATCH v2 05/13] enc28j60: Switch to use module_spi_driver() macro Andy Shevchenko
2019-03-18 16:10 ` [PATCH v2 06/13] enc28j60: Use ether_addr_copy() in enc28j60_set_mac_address() Andy Shevchenko
2019-03-18 16:10 ` [PATCH v2 07/13] enc28j60: Switch to dev_<level> from pr_<level> Andy Shevchenko
2019-03-18 16:10 ` [PATCH v2 08/13] enc28j60: Convert HW related printk() to dev_printk() Andy Shevchenko
2019-03-18 16:10 ` [PATCH v2 09/13] enc28j60: Convert printk() to netdev_printk() Andy Shevchenko
2019-03-18 16:10 ` [PATCH v2 10/13] enc28j60: Remove linux/init.h Andy Shevchenko
2019-03-18 16:11 ` [PATCH v2 11/13] enc28j60: Amend comments by fixing typos, adding periods, etc Andy Shevchenko
2019-03-18 16:11 ` [PATCH v2 12/13] enc28j60: Fix indentation splats Andy Shevchenko
2019-03-18 16:11 ` [PATCH v2 13/13] enc28j60: Convert to use SPDX identifier Andy Shevchenko
2019-03-19  5:23 ` [PATCH v2 01/13] enc28j60: Use device_get_mac_address() David Miller
2019-03-19 10:17   ` Andy Shevchenko
2019-03-19 17:55     ` David Miller
2019-03-19 18:49       ` Andy Shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2019-03-19 18:49 [PATCH v2 00/13] enc28j60: messaging clean up and ACPI improvements Andy Shevchenko
2019-03-19 18:49 ` [PATCH v2 13/13] enc28j60: Convert to use SPDX identifier Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).