summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/wiznet/w5100-spi.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2016-05-14 14:55:50 +0900
committerDavid S. Miller <davem@davemloft.net>2016-05-16 13:55:49 -0400
commitc3875ca7d9f9ad135debc78e211ea062ac48323c (patch)
tree8175848962e7b2aa6887a6f1a89a9acc7a1460f4 /drivers/net/ethernet/wiznet/w5100-spi.c
parent7d6da453efce17fae35707fa7e5757e7ade8b3cc (diff)
downloadop-kernel-dev-c3875ca7d9f9ad135debc78e211ea062ac48323c.zip
op-kernel-dev-c3875ca7d9f9ad135debc78e211ea062ac48323c.tar.gz
net: w5100-spi: add support to specify MAC address by device tree
This adds support to specify the MAC address by 'mac-address' or 'local-mac-address' properties in the device tree. These are common properties for the Ethernet controller. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Mike Sinkovsky <msink@permonline.ru> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/wiznet/w5100-spi.c')
-rw-r--r--drivers/net/ethernet/wiznet/w5100-spi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/wiznet/w5100-spi.c b/drivers/net/ethernet/wiznet/w5100-spi.c
index b868e45..93a2d3c 100644
--- a/drivers/net/ethernet/wiznet/w5100-spi.c
+++ b/drivers/net/ethernet/wiznet/w5100-spi.c
@@ -15,6 +15,7 @@
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
+#include <linux/of_net.h>
#include <linux/spi/spi.h>
#include "w5100.h"
@@ -414,6 +415,7 @@ static int w5100_spi_probe(struct spi_device *spi)
const struct spi_device_id *id = spi_get_device_id(spi);
const struct w5100_ops *ops;
int priv_size;
+ const void *mac = of_get_mac_address(spi->dev.of_node);
switch (id->driver_data) {
case W5100:
@@ -432,7 +434,7 @@ static int w5100_spi_probe(struct spi_device *spi)
return -EINVAL;
}
- return w5100_probe(&spi->dev, ops, priv_size, NULL, spi->irq, -EINVAL);
+ return w5100_probe(&spi->dev, ops, priv_size, mac, spi->irq, -EINVAL);
}
static int w5100_spi_remove(struct spi_device *spi)
OpenPOWER on IntegriCloud