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/sungem.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/sungem.c')
-rw-r--r-- | drivers/net/sungem.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 38cd30cb7c75..5248670d29f7 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -2880,17 +2880,20 @@ static int __devinit gem_get_device_address(struct gem *gp) | |||
2880 | #if defined(__sparc__) | 2880 | #if defined(__sparc__) |
2881 | struct pci_dev *pdev = gp->pdev; | 2881 | struct pci_dev *pdev = gp->pdev; |
2882 | struct pcidev_cookie *pcp = pdev->sysdata; | 2882 | struct pcidev_cookie *pcp = pdev->sysdata; |
2883 | int node = -1; | 2883 | int use_idprom = 1; |
2884 | 2884 | ||
2885 | if (pcp != NULL) { | 2885 | if (pcp != NULL) { |
2886 | node = pcp->prom_node; | 2886 | unsigned char *addr; |
2887 | if (prom_getproplen(node, "local-mac-address") == 6) | 2887 | int len; |
2888 | prom_getproperty(node, "local-mac-address", | 2888 | |
2889 | dev->dev_addr, 6); | 2889 | addr = of_get_property(pcp->prom_node, "local-mac-address", |
2890 | else | 2890 | &len); |
2891 | node = -1; | 2891 | if (addr && len == 6) { |
2892 | use_idprom = 0; | ||
2893 | memcpy(dev->dev_addr, addr, 6); | ||
2894 | } | ||
2892 | } | 2895 | } |
2893 | if (node == -1) | 2896 | if (use_idprom) |
2894 | memcpy(dev->dev_addr, idprom->id_ethaddr, 6); | 2897 | memcpy(dev->dev_addr, idprom->id_ethaddr, 6); |
2895 | #elif defined(CONFIG_PPC_PMAC) | 2898 | #elif defined(CONFIG_PPC_PMAC) |
2896 | unsigned char *addr; | 2899 | unsigned char *addr; |