diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-06-22 19:18:54 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-24 02:15:26 -0400 |
commit | de8d28b16f5614aeb12bb69c8f9a38578b8d3ada (patch) | |
tree | 152f0930dc099606342e9cc6d9a3892cd9f3f192 /drivers/net/tg3.c | |
parent | 765b5f32730cfd2608291e679060b0391570c8b3 (diff) |
[SPARC64]: Convert sparc64 PCI layer to in-kernel device tree.
One thing this change pointed out was that we really should
pull the "get 'local-mac-address' property" logic into a helper
function all the network drivers can call.
Signed-off-by: David S. Miller <davem@davemloft.net>
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 | } |