38ef4187affd6b9bb5b7d160e1f3886137b30bdb
[openwrt/openwrt.git] / target / linux / ramips / patches-4.3 / 0600-net-mediatek-add-of_get_mac_address_mtd-support.patch
1 From fce0d89383e0a2a694723989da608df1a464bae4 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Sun, 13 Dec 2015 17:45:19 +0100
4 Subject: [PATCH 1/2] net: mediatek: add of_get_mac_address_mtd() support
5
6 Signed-off-by: John Crispin <blogic@openwrt.org>
7 ---
8 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 5 +----
9 1 file changed, 1 insertion(+), 4 deletions(-)
10
11 diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
12 index fb435fa..9999768 100644
13 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
14 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
15 @@ -1273,7 +1273,6 @@ static int __init fe_init(struct net_device *dev)
16 {
17 struct fe_priv *priv = netdev_priv(dev);
18 struct device_node *port;
19 - const char *mac_addr;
20 int err;
21
22 priv->soc->reset_fe();
23 @@ -1281,9 +1280,7 @@ static int __init fe_init(struct net_device *dev)
24 if (priv->soc->switch_init)
25 priv->soc->switch_init(priv);
26
27 - mac_addr = of_get_mac_address(priv->device->of_node);
28 - if (mac_addr)
29 - ether_addr_copy(dev->dev_addr, mac_addr);
30 + of_get_mac_address_mtd(priv->device->of_node, dev->dev_addr);
31
32 /*If the mac address is invalid, use random mac address */
33 if (!is_valid_ether_addr(dev->dev_addr)) {
34 --
35 1.7.10.4
36