diff options
-rw-r--r-- | drivers/net/wireless/orinoco_nortel.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco_pci.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco_pci.h | 26 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco_plx.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco_tmd.c | 5 |
5 files changed, 12 insertions, 34 deletions
diff --git a/drivers/net/wireless/orinoco_nortel.c b/drivers/net/wireless/orinoco_nortel.c index 1596182f7412..74b9d5b2ba9e 100644 --- a/drivers/net/wireless/orinoco_nortel.c +++ b/drivers/net/wireless/orinoco_nortel.c | |||
@@ -206,7 +206,6 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev, | |||
206 | err = -EBUSY; | 206 | err = -EBUSY; |
207 | goto fail_irq; | 207 | goto fail_irq; |
208 | } | 208 | } |
209 | orinoco_pci_setup_netdev(dev, pdev, 2); | ||
210 | 209 | ||
211 | err = orinoco_nortel_hw_init(card); | 210 | err = orinoco_nortel_hw_init(card); |
212 | if (err) { | 211 | if (err) { |
@@ -227,6 +226,8 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev, | |||
227 | } | 226 | } |
228 | 227 | ||
229 | pci_set_drvdata(pdev, dev); | 228 | pci_set_drvdata(pdev, dev); |
229 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, | ||
230 | pci_name(pdev)); | ||
230 | 231 | ||
231 | return 0; | 232 | return 0; |
232 | 233 | ||
@@ -265,7 +266,7 @@ static void __devexit orinoco_nortel_remove_one(struct pci_dev *pdev) | |||
265 | iowrite16(0, card->bridge_io + 10); | 266 | iowrite16(0, card->bridge_io + 10); |
266 | 267 | ||
267 | unregister_netdev(dev); | 268 | unregister_netdev(dev); |
268 | free_irq(dev->irq, dev); | 269 | free_irq(pdev->irq, dev); |
269 | pci_set_drvdata(pdev, NULL); | 270 | pci_set_drvdata(pdev, NULL); |
270 | free_orinocodev(dev); | 271 | free_orinocodev(dev); |
271 | pci_iounmap(pdev, priv->hw.iobase); | 272 | pci_iounmap(pdev, priv->hw.iobase); |
diff --git a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c index df37b95607ff..1c105f40f8d5 100644 --- a/drivers/net/wireless/orinoco_pci.c +++ b/drivers/net/wireless/orinoco_pci.c | |||
@@ -161,7 +161,6 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
161 | err = -EBUSY; | 161 | err = -EBUSY; |
162 | goto fail_irq; | 162 | goto fail_irq; |
163 | } | 163 | } |
164 | orinoco_pci_setup_netdev(dev, pdev, 0); | ||
165 | 164 | ||
166 | err = orinoco_pci_cor_reset(priv); | 165 | err = orinoco_pci_cor_reset(priv); |
167 | if (err) { | 166 | if (err) { |
@@ -176,6 +175,8 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
176 | } | 175 | } |
177 | 176 | ||
178 | pci_set_drvdata(pdev, dev); | 177 | pci_set_drvdata(pdev, dev); |
178 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, | ||
179 | pci_name(pdev)); | ||
179 | 180 | ||
180 | return 0; | 181 | return 0; |
181 | 182 | ||
@@ -204,7 +205,7 @@ static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev) | |||
204 | struct orinoco_private *priv = netdev_priv(dev); | 205 | struct orinoco_private *priv = netdev_priv(dev); |
205 | 206 | ||
206 | unregister_netdev(dev); | 207 | unregister_netdev(dev); |
207 | free_irq(dev->irq, dev); | 208 | free_irq(pdev->irq, dev); |
208 | pci_set_drvdata(pdev, NULL); | 209 | pci_set_drvdata(pdev, NULL); |
209 | free_orinocodev(dev); | 210 | free_orinocodev(dev); |
210 | pci_iounmap(pdev, priv->hw.iobase); | 211 | pci_iounmap(pdev, priv->hw.iobase); |
diff --git a/drivers/net/wireless/orinoco_pci.h b/drivers/net/wireless/orinoco_pci.h index 4e8da4ea29f1..7eb1e08113e0 100644 --- a/drivers/net/wireless/orinoco_pci.h +++ b/drivers/net/wireless/orinoco_pci.h | |||
@@ -18,32 +18,6 @@ struct orinoco_pci_card { | |||
18 | void __iomem *attr_io; | 18 | void __iomem *attr_io; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | /* Set base address or memory range of the network device based on | ||
22 | * the PCI device it's using. Specify BAR of the "main" resource. | ||
23 | * To be used after request_irq(). */ | ||
24 | static inline void orinoco_pci_setup_netdev(struct net_device *dev, | ||
25 | struct pci_dev *pdev, int bar) | ||
26 | { | ||
27 | char *range_type; | ||
28 | unsigned long start = pci_resource_start(pdev, bar); | ||
29 | unsigned long len = pci_resource_len(pdev, bar); | ||
30 | unsigned long flags = pci_resource_flags(pdev, bar); | ||
31 | unsigned long end = start + len - 1; | ||
32 | |||
33 | dev->irq = pdev->irq; | ||
34 | if (flags & IORESOURCE_IO) { | ||
35 | dev->base_addr = start; | ||
36 | range_type = "ports"; | ||
37 | } else { | ||
38 | dev->mem_start = start; | ||
39 | dev->mem_end = end; | ||
40 | range_type = "memory"; | ||
41 | } | ||
42 | |||
43 | printk(KERN_DEBUG PFX "%s: irq %d, %s 0x%lx-0x%lx\n", | ||
44 | pci_name(pdev), pdev->irq, range_type, start, end); | ||
45 | } | ||
46 | |||
47 | #ifdef CONFIG_PM | 21 | #ifdef CONFIG_PM |
48 | static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state) | 22 | static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state) |
49 | { | 23 | { |
diff --git a/drivers/net/wireless/orinoco_plx.c b/drivers/net/wireless/orinoco_plx.c index 7b9405096389..84f696c77551 100644 --- a/drivers/net/wireless/orinoco_plx.c +++ b/drivers/net/wireless/orinoco_plx.c | |||
@@ -245,7 +245,6 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, | |||
245 | err = -EBUSY; | 245 | err = -EBUSY; |
246 | goto fail_irq; | 246 | goto fail_irq; |
247 | } | 247 | } |
248 | orinoco_pci_setup_netdev(dev, pdev, 2); | ||
249 | 248 | ||
250 | err = orinoco_plx_hw_init(card); | 249 | err = orinoco_plx_hw_init(card); |
251 | if (err) { | 250 | if (err) { |
@@ -266,6 +265,8 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, | |||
266 | } | 265 | } |
267 | 266 | ||
268 | pci_set_drvdata(pdev, dev); | 267 | pci_set_drvdata(pdev, dev); |
268 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, | ||
269 | pci_name(pdev)); | ||
269 | 270 | ||
270 | return 0; | 271 | return 0; |
271 | 272 | ||
@@ -301,7 +302,7 @@ static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev) | |||
301 | struct orinoco_pci_card *card = priv->card; | 302 | struct orinoco_pci_card *card = priv->card; |
302 | 303 | ||
303 | unregister_netdev(dev); | 304 | unregister_netdev(dev); |
304 | free_irq(dev->irq, dev); | 305 | free_irq(pdev->irq, dev); |
305 | pci_set_drvdata(pdev, NULL); | 306 | pci_set_drvdata(pdev, NULL); |
306 | free_orinocodev(dev); | 307 | free_orinocodev(dev); |
307 | pci_iounmap(pdev, priv->hw.iobase); | 308 | pci_iounmap(pdev, priv->hw.iobase); |
diff --git a/drivers/net/wireless/orinoco_tmd.c b/drivers/net/wireless/orinoco_tmd.c index 0496663e837c..d2b4decb7a7d 100644 --- a/drivers/net/wireless/orinoco_tmd.c +++ b/drivers/net/wireless/orinoco_tmd.c | |||
@@ -147,7 +147,6 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, | |||
147 | err = -EBUSY; | 147 | err = -EBUSY; |
148 | goto fail_irq; | 148 | goto fail_irq; |
149 | } | 149 | } |
150 | orinoco_pci_setup_netdev(dev, pdev, 2); | ||
151 | 150 | ||
152 | err = orinoco_tmd_cor_reset(priv); | 151 | err = orinoco_tmd_cor_reset(priv); |
153 | if (err) { | 152 | if (err) { |
@@ -162,6 +161,8 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, | |||
162 | } | 161 | } |
163 | 162 | ||
164 | pci_set_drvdata(pdev, dev); | 163 | pci_set_drvdata(pdev, dev); |
164 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, | ||
165 | pci_name(pdev)); | ||
165 | 166 | ||
166 | return 0; | 167 | return 0; |
167 | 168 | ||
@@ -194,7 +195,7 @@ static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev) | |||
194 | struct orinoco_pci_card *card = priv->card; | 195 | struct orinoco_pci_card *card = priv->card; |
195 | 196 | ||
196 | unregister_netdev(dev); | 197 | unregister_netdev(dev); |
197 | free_irq(dev->irq, dev); | 198 | free_irq(pdev->irq, dev); |
198 | pci_set_drvdata(pdev, NULL); | 199 | pci_set_drvdata(pdev, NULL); |
199 | free_orinocodev(dev); | 200 | free_orinocodev(dev); |
200 | pci_iounmap(pdev, priv->hw.iobase); | 201 | pci_iounmap(pdev, priv->hw.iobase); |