]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/sunhme.c
[TCP] FRTO: Improve interoperability with other undo_marker users
[linux-2.6-omap-h63xx.git] / drivers / net / sunhme.c
index 5304d7b94e5e7fe85a5589170e42fd1119d055ba..120c8affe83dba36f29f972657fc05954af6284d 100644 (file)
@@ -55,9 +55,6 @@
 
 #ifdef CONFIG_PCI
 #include <linux/pci.h>
-#ifdef CONFIG_SPARC
-#include <asm/pbm.h>
-#endif
 #endif
 
 #include "sunhme.h"
@@ -2628,7 +2625,7 @@ static void quattro_sbus_free_irqs(void)
 #endif /* CONFIG_SBUS */
 
 #ifdef CONFIG_PCI
-static struct quattro * __init quattro_pci_find(struct pci_dev *pdev)
+static struct quattro * __devinit quattro_pci_find(struct pci_dev *pdev)
 {
        struct pci_dev *bdev = pdev->bus->self;
        struct quattro *qp;
@@ -2667,6 +2664,7 @@ static int __devinit happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe
        struct net_device *dev;
        int i, qfe_slot = -1;
        int err = -ENODEV;
+       DECLARE_MAC_BUF(mac);
 
        if (is_qfe) {
                qp = quattro_sbus_find(sdev);
@@ -2683,7 +2681,6 @@ static int __devinit happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe
        dev = alloc_etherdev(sizeof(struct happy_meal));
        if (!dev)
                goto err_out;
-       SET_MODULE_OWNER(dev);
        SET_NETDEV_DEV(dev, &sdev->ofdev.dev);
 
        if (hme_version_printed++ == 0)
@@ -2701,7 +2698,7 @@ static int __devinit happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe
                        dev->dev_addr[i] = macaddr[i];
                macaddr[5]++;
        } else {
-               unsigned char *addr;
+               const unsigned char *addr;
                int len;
 
                addr = of_get_property(dp, "local-mac-address", &len);
@@ -2854,10 +2851,7 @@ static int __devinit happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe
                printk(KERN_INFO "%s: HAPPY MEAL (SBUS) 10/100baseT Ethernet ",
                       dev->name);
 
-       for (i = 0; i < 6; i++)
-               printk("%2.2x%c",
-                      dev->dev_addr[i], i == 5 ? ' ' : ':');
-       printk("\n");
+       printk("%s\n", print_mac(mac, dev->dev_addr));
 
        return 0;
 
@@ -2983,7 +2977,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
 {
        struct quattro *qp = NULL;
 #ifdef CONFIG_SPARC
-       struct pcidev_cookie *pcp;
+       struct device_node *dp;
 #endif
        struct happy_meal *hp;
        struct net_device *dev;
@@ -2992,16 +2986,12 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
        int i, qfe_slot = -1;
        char prom_name[64];
        int err;
+       DECLARE_MAC_BUF(mac);
 
        /* Now make sure pci_dev cookie is there. */
 #ifdef CONFIG_SPARC
-       pcp = pdev->sysdata;
-       if (pcp == NULL) {
-               printk(KERN_ERR "happymeal(PCI): Some PCI device info missing\n");
-               return -ENODEV;
-       }
-
-       strcpy(prom_name, pcp->prom_node->name);
+       dp = pci_device_to_OF_node(pdev);
+       strcpy(prom_name, dp->name);
 #else
        if (is_quattro_p(pdev))
                strcpy(prom_name, "SUNW,qfe");
@@ -3030,7 +3020,6 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
        err = -ENOMEM;
        if (!dev)
                goto err_out;
-       SET_MODULE_OWNER(dev);
        SET_NETDEV_DEV(dev, &pdev->dev);
 
        if (hme_version_printed++ == 0)
@@ -3078,11 +3067,11 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
                macaddr[5]++;
        } else {
 #ifdef CONFIG_SPARC
-               unsigned char *addr;
+               const unsigned char *addr;
                int len;
 
                if (qfe_slot != -1 &&
-                   (addr = of_get_property(pcp->prom_node,
+                   (addr = of_get_property(dp,
                                            "local-mac-address", &len)) != NULL
                    && len == 6) {
                        memcpy(dev->dev_addr, addr, 6);
@@ -3102,13 +3091,9 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
        hp->tcvregs    = (hpreg_base + 0x7000UL);
 
 #ifdef CONFIG_SPARC
-       hp->hm_revision = of_getintprop_default(pcp->prom_node, "hm-rev", 0xff);
-       if (hp->hm_revision == 0xff) {
-               unsigned char prev;
-
-               pci_read_config_byte(pdev, PCI_REVISION_ID, &prev);
-               hp->hm_revision = 0xc0 | (prev & 0x0f);
-       }
+       hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff);
+       if (hp->hm_revision == 0xff)
+               hp->hm_revision = 0xc0 | (pdev->revision & 0x0f);
 #else
        /* works with this on non-sparc hosts */
        hp->hm_revision = 0x20;
@@ -3215,10 +3200,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
                printk(KERN_INFO "%s: HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet ",
                       dev->name);
 
-       for (i = 0; i < 6; i++)
-               printk("%2.2x%c", dev->dev_addr[i], i == 5 ? ' ' : ':');
-
-       printk("\n");
+       printk("%s\n", print_mac(mac, dev->dev_addr));
 
        return 0;
 
@@ -3297,7 +3279,7 @@ static int __devinit hme_sbus_probe(struct of_device *dev, const struct of_devic
 {
        struct sbus_dev *sdev = to_sbus_device(&dev->dev);
        struct device_node *dp = dev->node;
-       char *model = of_get_property(dp, "model", NULL);
+       const char *model = of_get_property(dp, "model", NULL);
        int is_qfe = (match->data != NULL);
 
        if (!is_qfe && model && !strcmp(model, "SUNW,sbus-qfe"))