diff options
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e3e380f90f86..35f931638750 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -10549,11 +10549,13 @@ static int __devinit tg3_get_macaddr_sparc(struct tg3 *tp) | |||
10549 | struct pcidev_cookie *pcp = pdev->sysdata; | 10549 | struct pcidev_cookie *pcp = pdev->sysdata; |
10550 | 10550 | ||
10551 | if (pcp != NULL) { | 10551 | if (pcp != NULL) { |
10552 | int node = pcp->prom_node; | 10552 | unsigned char *addr; |
10553 | int len; | ||
10553 | 10554 | ||
10554 | if (prom_getproplen(node, "local-mac-address") == 6) { | 10555 | addr = of_get_property(pcp->prom_node, "local-mac-address", |
10555 | prom_getproperty(node, "local-mac-address", | 10556 | &len); |
10556 | dev->dev_addr, 6); | 10557 | if (addr && len == 6) { |
10558 | memcpy(dev->dev_addr, addr, 6); | ||
10557 | memcpy(dev->perm_addr, dev->dev_addr, 6); | 10559 | memcpy(dev->perm_addr, dev->dev_addr, 6); |
10558 | return 0; | 10560 | return 0; |
10559 | } | 10561 | } |