Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=457e1a8afbcf5deffa501f2e9829526c18ed55b5
Commit:     457e1a8afbcf5deffa501f2e9829526c18ed55b5
Parent:     dadb830dac401c4b1420ee2fd6c7559871b43319
Author:     David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 29 01:36:44 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Apr 26 01:54:48 2007 -0700

    [SUNGEM]: Consolidate powerpc and sparc MAC probing code.
    
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/sungem.c |   31 ++++++-------------------------
 drivers/net/sungem.h |    2 +-
 2 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 4fa3e49..07f3890 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -66,9 +66,7 @@
 
 #ifdef CONFIG_SPARC
 #include <asm/idprom.h>
-#include <asm/openprom.h>
-#include <asm/oplib.h>
-#include <asm/pbm.h>
+#include <asm/prom.h>
 #endif
 
 #ifdef CONFIG_PPC_PMAC
@@ -2906,34 +2904,17 @@ static int __devinit gem_get_device_address(struct gem 
*gp)
 {
 #if defined(CONFIG_SPARC) || defined(CONFIG_PPC_PMAC)
        struct net_device *dev = gp->dev;
-#endif
-
-#if defined(CONFIG_SPARC)
-       struct pci_dev *pdev = gp->pdev;
-       struct pcidev_cookie *pcp = pdev->sysdata;
-       int use_idprom = 1;
-
-       if (pcp != NULL) {
-               const unsigned char *addr;
-               int len;
-
-               addr = of_get_property(pcp->prom_node, "local-mac-address",
-                                      &len);
-               if (addr && len == 6) {
-                       use_idprom = 0;
-                       memcpy(dev->dev_addr, addr, 6);
-               }
-       }
-       if (use_idprom)
-               memcpy(dev->dev_addr, idprom->id_ethaddr, 6);
-#elif defined(CONFIG_PPC_PMAC)
        const unsigned char *addr;
 
        addr = get_property(gp->of_node, "local-mac-address", NULL);
        if (addr == NULL) {
+#ifdef CONFIG_SPARC
+               addr = idprom->id_ethaddr;
+#else
                printk("\n");
                printk(KERN_ERR "%s: can't get mac-address\n", dev->name);
                return -1;
+#endif
        }
        memcpy(dev->dev_addr, addr, 6);
 #else
@@ -3091,7 +3072,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
        /* On Apple, we want a reference to the Open Firmware device-tree
         * node. We use it for clock control.
         */
-#ifdef CONFIG_PPC_PMAC
+#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_SPARC)
        gp->of_node = pci_device_to_OF_node(pdev);
 #endif
 
diff --git a/drivers/net/sungem.h b/drivers/net/sungem.h
index a70067c..58cf87c 100644
--- a/drivers/net/sungem.h
+++ b/drivers/net/sungem.h
@@ -1025,7 +1025,7 @@ struct gem {
 
        struct pci_dev          *pdev;
        struct net_device       *dev;
-#ifdef CONFIG_PPC_PMAC
+#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_SPARC)
        struct device_node      *of_node;
 #endif
 };
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to