]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[PATCH] orinoco: don't put PCI resource data to the network device
authorPavel Roskin <proski@gnu.org>
Mon, 1 May 2006 06:13:33 +0000 (02:13 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 5 May 2006 21:10:41 +0000 (17:10 -0400)
The resource data in the network device is intended for ISA and other
older busses, but not for PCI.  Don't put PCI data there.  Don't (ab)use
the network device for keeping the IRQ number.

Retire orinoco_pci_setup_netdev(), and print some minimal information to
the kernel log instead, identifying the network device and the driver
mostly to identify problems at startup.  Scripts should rely on sysfs.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/orinoco_nortel.c
drivers/net/wireless/orinoco_pci.c
drivers/net/wireless/orinoco_pci.h
drivers/net/wireless/orinoco_plx.c
drivers/net/wireless/orinoco_tmd.c

index 1596182f7412996a8772effe935e4fb9ce1760ad..74b9d5b2ba9ee00005586938f832cf4c1f36911e 100644 (file)
@@ -206,7 +206,6 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
                err = -EBUSY;
                goto fail_irq;
        }
-       orinoco_pci_setup_netdev(dev, pdev, 2);
 
        err = orinoco_nortel_hw_init(card);
        if (err) {
@@ -227,6 +226,8 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
        }
 
        pci_set_drvdata(pdev, dev);
+       printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
+              pci_name(pdev));
 
        return 0;
 
@@ -265,7 +266,7 @@ static void __devexit orinoco_nortel_remove_one(struct pci_dev *pdev)
        iowrite16(0, card->bridge_io + 10);
 
        unregister_netdev(dev);
-       free_irq(dev->irq, dev);
+       free_irq(pdev->irq, dev);
        pci_set_drvdata(pdev, NULL);
        free_orinocodev(dev);
        pci_iounmap(pdev, priv->hw.iobase);
index df37b95607ff3825f3cc0d6da8185a4a08415fe5..1c105f40f8d55f250f344f0e2427baf150bcb3d8 100644 (file)
@@ -161,7 +161,6 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
                err = -EBUSY;
                goto fail_irq;
        }
-       orinoco_pci_setup_netdev(dev, pdev, 0);
 
        err = orinoco_pci_cor_reset(priv);
        if (err) {
@@ -176,6 +175,8 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
        }
 
        pci_set_drvdata(pdev, dev);
+       printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
+              pci_name(pdev));
 
        return 0;
 
@@ -204,7 +205,7 @@ static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev)
        struct orinoco_private *priv = netdev_priv(dev);
 
        unregister_netdev(dev);
-       free_irq(dev->irq, dev);
+       free_irq(pdev->irq, dev);
        pci_set_drvdata(pdev, NULL);
        free_orinocodev(dev);
        pci_iounmap(pdev, priv->hw.iobase);
index 4e8da4ea29f1f28cd469842da3cbd762f4534108..7eb1e08113e0886fa1b9e3ddfc9d0e529991ecb1 100644 (file)
@@ -18,32 +18,6 @@ struct orinoco_pci_card {
        void __iomem *attr_io;
 };
 
-/* Set base address or memory range of the network device based on
- * the PCI device it's using.  Specify BAR of the "main" resource.
- * To be used after request_irq().  */
-static inline void orinoco_pci_setup_netdev(struct net_device *dev,
-                                           struct pci_dev *pdev, int bar)
-{
-       char *range_type;
-       unsigned long start = pci_resource_start(pdev, bar);
-       unsigned long len = pci_resource_len(pdev, bar);
-       unsigned long flags = pci_resource_flags(pdev, bar);
-       unsigned long end = start + len - 1;
-
-       dev->irq = pdev->irq;
-       if (flags & IORESOURCE_IO) {
-               dev->base_addr = start;
-               range_type = "ports";
-       } else {
-               dev->mem_start = start;
-               dev->mem_end = end;
-               range_type = "memory";
-       }
-
-       printk(KERN_DEBUG PFX "%s: irq %d, %s 0x%lx-0x%lx\n",
-              pci_name(pdev), pdev->irq, range_type, start, end);
-}
-
 #ifdef CONFIG_PM
 static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 {
index 7b9405096389586615ca86467dbc35351d739d56..84f696c77551e1ce420a6e7341e0a3f0717e73c7 100644 (file)
@@ -245,7 +245,6 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
                err = -EBUSY;
                goto fail_irq;
        }
-       orinoco_pci_setup_netdev(dev, pdev, 2);
 
        err = orinoco_plx_hw_init(card);
        if (err) {
@@ -266,6 +265,8 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
        }
 
        pci_set_drvdata(pdev, dev);
+       printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
+              pci_name(pdev));
 
        return 0;
 
@@ -301,7 +302,7 @@ static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev)
        struct orinoco_pci_card *card = priv->card;
 
        unregister_netdev(dev);
-       free_irq(dev->irq, dev);
+       free_irq(pdev->irq, dev);
        pci_set_drvdata(pdev, NULL);
        free_orinocodev(dev);
        pci_iounmap(pdev, priv->hw.iobase);
index 0496663e837c5d4b6e9dacb7eca48ffd5ad51bc8..d2b4decb7a7d005cdf87c2c91d9269f7f5e8cd92 100644 (file)
@@ -147,7 +147,6 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
                err = -EBUSY;
                goto fail_irq;
        }
-       orinoco_pci_setup_netdev(dev, pdev, 2);
 
        err = orinoco_tmd_cor_reset(priv);
        if (err) {
@@ -162,6 +161,8 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
        }
 
        pci_set_drvdata(pdev, dev);
+       printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
+              pci_name(pdev));
 
        return 0;
 
@@ -194,7 +195,7 @@ static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev)
        struct orinoco_pci_card *card = priv->card;
 
        unregister_netdev(dev);
-       free_irq(dev->irq, dev);
+       free_irq(pdev->irq, dev);
        pci_set_drvdata(pdev, NULL);
        free_orinocodev(dev);
        pci_iounmap(pdev, priv->hw.iobase);