summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-09-05 13:59:31 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-09-05 13:59:31 +0200
commit91a68050e1607ca53f9733b90a43a0b473bce58e (patch)
treeac26f286985f03f2ae6b5931c4a53a5ae51457d0 /net
parent7f6b6d25d899fea83412255d1d819e3b6450f144 (diff)
parent99fbfdfc1b0e7a1366534a5dbcaf4d3d7c71ead3 (diff)
downloadbarebox-91a68050e1607ca53f9733b90a43a0b473bce58e.tar.gz
barebox-91a68050e1607ca53f9733b90a43a0b473bce58e.tar.xz
Merge branch 'for-next/powerpc'
Diffstat (limited to 'net')
-rw-r--r--net/eth.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/net/eth.c b/net/eth.c
index e94689ad8a..e5d6a35822 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -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;
}