diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-09-05 13:59:31 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-09-05 13:59:31 +0200 |
commit | 91a68050e1607ca53f9733b90a43a0b473bce58e (patch) | |
tree | ac26f286985f03f2ae6b5931c4a53a5ae51457d0 /net | |
parent | 7f6b6d25d899fea83412255d1d819e3b6450f144 (diff) | |
parent | 99fbfdfc1b0e7a1366534a5dbcaf4d3d7c71ead3 (diff) | |
download | barebox-91a68050e1607ca53f9733b90a43a0b473bce58e.tar.gz barebox-91a68050e1607ca53f9733b90a43a0b473bce58e.tar.xz |
Merge branch 'for-next/powerpc'
Diffstat (limited to 'net')
-rw-r--r-- | net/eth.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -273,7 +273,7 @@ static int eth_set_ethaddr(struct device_d *dev, struct param_d *param, const ch return 0; } -#ifdef CONFIG_OFDEVICE +#ifdef CONFIG_OFTREE static int eth_of_fixup(struct device_node *root) { struct eth_device *edev; @@ -285,21 +285,23 @@ static int eth_of_fixup(struct device_node *root) * find a nodepath for and which has a valid mac address. */ list_for_each_entry(edev, &netdev_list, list) { - if (!edev->nodepath) { - dev_dbg(&edev->dev, "%s: no node to fixup\n", __func__); + if (!is_valid_ether_addr(edev->ethaddr)) { + dev_dbg(&edev->dev, + "%s: no valid mac address, cannot fixup\n", + __func__); continue; } - if (!is_valid_ether_addr(edev->ethaddr)) { - dev_dbg(&edev->dev, "%s: no valid mac address, cannot fixup\n", - __func__); - continue; + if (edev->nodepath) { + node = of_find_node_by_path_from(root, edev->nodepath); + } else { + char eth[12]; + sprintf(eth, "ethernet%d", edev->dev.id); + node = of_find_node_by_alias(root, eth); } - node = of_find_node_by_path_from(root, edev->nodepath); if (!node) { - dev_dbg(&edev->dev, "%s: fixup node %s not found\n", - __func__, edev->nodepath); + dev_dbg(&edev->dev, "%s: no node to fixup\n", __func__); continue; } |