From c2b94cdf322ca0477e8a8afc056599be2d3082e8 Mon Sep 17 00:00:00 2001 From: Andy Gospodarek Date: Wed, 7 May 2008 11:44:55 -0400 Subject: [PATCH] tg3: revert part of upstream SPARC fix RHBZ: 436686 This reverts part of the changes from the following upstream commit. I kept the changes that changed the dependancy from CONFIG_SPARC64 to CONFIG_SPARC but got rid of the changes that required pci_device_to_OF_node since it is not available on SPARC. commit 49b6e95ff6d05722bcf7a52b00454566ce0c44eb Author: David S. Miller Date: Thu Mar 29 01:38:42 2007 -0700 [TG3]: Use pci_device_to_OF_node() on sparc. And use CONFIG_SPARC instead of CONFIG_SPARC64 as the test. --- drivers/net/tg3.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index c23fb64..69f85a7 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -11808,15 +11808,19 @@ static int __devinit tg3_get_macaddr_sparc(struct tg3 *tp) { struct net_device *dev = tp->dev; struct pci_dev *pdev = tp->pdev; - struct device_node *dp = pci_device_to_OF_node(pdev); - const unsigned char *addr; - int len; - - addr = of_get_property(dp, "local-mac-address", &len); - if (addr && len == 6) { - memcpy(dev->dev_addr, addr, 6); - memcpy(dev->perm_addr, dev->dev_addr, 6); - return 0; + struct pcidev_cookie *pcp = pdev->sysdata; + + if (pcp != NULL) { + const unsigned char *addr; + int len; + + addr = of_get_property(pcp->prom_node, "local-mac-address", + &len); + if (addr && len == 6) { + memcpy(dev->dev_addr, addr, 6); + memcpy(dev->perm_addr, dev->dev_addr, 6); + return 0; + } } return -ENODEV; } -- 1.5.2.1