diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-03-20 14:39:26 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-05-10 04:23:16 -0400 |
commit | c7c2fa079073ab92b0736a161b4cf1051a3e631f (patch) | |
tree | c23bb2e89f68601e5c37a1a0df9e83c9e71f9dd6 /drivers/net/pcmcia | |
parent | ded6a1a341cb38c4cfeb09d3d01ffe16b5c804b3 (diff) |
pcmcia: dev_node removal (drivers with unregister_netdev check)
As a third step, remove any usage of dev_node_t from drivers which
only wrote to this typedef/struct, except to determine whether
register_netdev() succeeded previously. However, the function calling
unregister_netdev() was only ever called by the PCMCIA core if
register_netdev() succeeded previously. The lonely exception was
easily fixed.
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 8 | ||||
-rw-r--r-- | drivers/net/pcmcia/3c589_cs.c | 9 | ||||
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 8 | ||||
-rw-r--r-- | drivers/net/pcmcia/com20020_cs.c | 21 | ||||
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 8 | ||||
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 8 | ||||
-rw-r--r-- | drivers/net/pcmcia/nmclan_cs.c | 8 | ||||
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 8 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 9 | ||||
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 29 |
10 files changed, 16 insertions, 100 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 14428317c009..774e41c7def0 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -200,7 +200,6 @@ enum Window4 { /* Window 4: Xcvr/media bits. */ | |||
200 | 200 | ||
201 | struct el3_private { | 201 | struct el3_private { |
202 | struct pcmcia_device *p_dev; | 202 | struct pcmcia_device *p_dev; |
203 | dev_node_t node; | ||
204 | u16 advertising, partner; /* NWay media advertisement */ | 203 | u16 advertising, partner; /* NWay media advertisement */ |
205 | unsigned char phys; /* MII device address */ | 204 | unsigned char phys; /* MII device address */ |
206 | unsigned int autoselect:1, default_media:3; /* Read from the EEPROM/Wn3_Config. */ | 205 | unsigned int autoselect:1, default_media:3; /* Read from the EEPROM/Wn3_Config. */ |
@@ -309,8 +308,7 @@ static void tc574_detach(struct pcmcia_device *link) | |||
309 | 308 | ||
310 | dev_dbg(&link->dev, "3c574_detach()\n"); | 309 | dev_dbg(&link->dev, "3c574_detach()\n"); |
311 | 310 | ||
312 | if (link->dev_node) | 311 | unregister_netdev(dev); |
313 | unregister_netdev(dev); | ||
314 | 312 | ||
315 | tc574_release(link); | 313 | tc574_release(link); |
316 | 314 | ||
@@ -444,17 +442,13 @@ static int tc574_config(struct pcmcia_device *link) | |||
444 | } | 442 | } |
445 | } | 443 | } |
446 | 444 | ||
447 | link->dev_node = &lp->node; | ||
448 | SET_NETDEV_DEV(dev, &link->dev); | 445 | SET_NETDEV_DEV(dev, &link->dev); |
449 | 446 | ||
450 | if (register_netdev(dev) != 0) { | 447 | if (register_netdev(dev) != 0) { |
451 | printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n"); | 448 | printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n"); |
452 | link->dev_node = NULL; | ||
453 | goto failed; | 449 | goto failed; |
454 | } | 450 | } |
455 | 451 | ||
456 | strcpy(lp->node.dev_name, dev->name); | ||
457 | |||
458 | printk(KERN_INFO "%s: %s at io %#3lx, irq %d, " | 452 | printk(KERN_INFO "%s: %s at io %#3lx, irq %d, " |
459 | "hw_addr %pM.\n", | 453 | "hw_addr %pM.\n", |
460 | dev->name, cardname, dev->base_addr, dev->irq, | 454 | dev->name, cardname, dev->base_addr, dev->irq, |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 405d772bfde7..5ab589d3b385 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -106,7 +106,6 @@ enum RxFilter { | |||
106 | 106 | ||
107 | struct el3_private { | 107 | struct el3_private { |
108 | struct pcmcia_device *p_dev; | 108 | struct pcmcia_device *p_dev; |
109 | dev_node_t node; | ||
110 | /* For transceiver monitoring */ | 109 | /* For transceiver monitoring */ |
111 | struct timer_list media; | 110 | struct timer_list media; |
112 | u16 media_status; | 111 | u16 media_status; |
@@ -222,8 +221,7 @@ static void tc589_detach(struct pcmcia_device *link) | |||
222 | 221 | ||
223 | dev_dbg(&link->dev, "3c589_detach\n"); | 222 | dev_dbg(&link->dev, "3c589_detach\n"); |
224 | 223 | ||
225 | if (link->dev_node) | 224 | unregister_netdev(dev); |
226 | unregister_netdev(dev); | ||
227 | 225 | ||
228 | tc589_release(link); | 226 | tc589_release(link); |
229 | 227 | ||
@@ -241,7 +239,6 @@ static void tc589_detach(struct pcmcia_device *link) | |||
241 | static int tc589_config(struct pcmcia_device *link) | 239 | static int tc589_config(struct pcmcia_device *link) |
242 | { | 240 | { |
243 | struct net_device *dev = link->priv; | 241 | struct net_device *dev = link->priv; |
244 | struct el3_private *lp = netdev_priv(dev); | ||
245 | __be16 *phys_addr; | 242 | __be16 *phys_addr; |
246 | int ret, i, j, multi = 0, fifo; | 243 | int ret, i, j, multi = 0, fifo; |
247 | unsigned int ioaddr; | 244 | unsigned int ioaddr; |
@@ -312,17 +309,13 @@ static int tc589_config(struct pcmcia_device *link) | |||
312 | else | 309 | else |
313 | printk(KERN_ERR "3c589_cs: invalid if_port requested\n"); | 310 | printk(KERN_ERR "3c589_cs: invalid if_port requested\n"); |
314 | 311 | ||
315 | link->dev_node = &lp->node; | ||
316 | SET_NETDEV_DEV(dev, &link->dev); | 312 | SET_NETDEV_DEV(dev, &link->dev); |
317 | 313 | ||
318 | if (register_netdev(dev) != 0) { | 314 | if (register_netdev(dev) != 0) { |
319 | printk(KERN_ERR "3c589_cs: register_netdev() failed\n"); | 315 | printk(KERN_ERR "3c589_cs: register_netdev() failed\n"); |
320 | link->dev_node = NULL; | ||
321 | goto failed; | 316 | goto failed; |
322 | } | 317 | } |
323 | 318 | ||
324 | strcpy(lp->node.dev_name, dev->name); | ||
325 | |||
326 | printk(KERN_INFO "%s: 3Com 3c%s, io %#3lx, irq %d, " | 319 | printk(KERN_INFO "%s: 3Com 3c%s, io %#3lx, irq %d, " |
327 | "hw_addr %pM\n", | 320 | "hw_addr %pM\n", |
328 | dev->name, (multi ? "562" : "589"), dev->base_addr, dev->irq, | 321 | dev->name, (multi ? "562" : "589"), dev->base_addr, dev->irq, |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 967547a84b4b..59f6fa3c9ddc 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -113,7 +113,6 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id); | |||
113 | 113 | ||
114 | typedef struct axnet_dev_t { | 114 | typedef struct axnet_dev_t { |
115 | struct pcmcia_device *p_dev; | 115 | struct pcmcia_device *p_dev; |
116 | dev_node_t node; | ||
117 | caddr_t base; | 116 | caddr_t base; |
118 | struct timer_list watchdog; | 117 | struct timer_list watchdog; |
119 | int stale, fast_poll; | 118 | int stale, fast_poll; |
@@ -194,8 +193,7 @@ static void axnet_detach(struct pcmcia_device *link) | |||
194 | 193 | ||
195 | dev_dbg(&link->dev, "axnet_detach(0x%p)\n", link); | 194 | dev_dbg(&link->dev, "axnet_detach(0x%p)\n", link); |
196 | 195 | ||
197 | if (link->dev_node) | 196 | unregister_netdev(dev); |
198 | unregister_netdev(dev); | ||
199 | 197 | ||
200 | axnet_release(link); | 198 | axnet_release(link); |
201 | 199 | ||
@@ -392,17 +390,13 @@ static int axnet_config(struct pcmcia_device *link) | |||
392 | } | 390 | } |
393 | 391 | ||
394 | info->phy_id = (i < 32) ? i : -1; | 392 | info->phy_id = (i < 32) ? i : -1; |
395 | link->dev_node = &info->node; | ||
396 | SET_NETDEV_DEV(dev, &link->dev); | 393 | SET_NETDEV_DEV(dev, &link->dev); |
397 | 394 | ||
398 | if (register_netdev(dev) != 0) { | 395 | if (register_netdev(dev) != 0) { |
399 | printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n"); | 396 | printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n"); |
400 | link->dev_node = NULL; | ||
401 | goto failed; | 397 | goto failed; |
402 | } | 398 | } |
403 | 399 | ||
404 | strcpy(info->node.dev_name, dev->name); | ||
405 | |||
406 | printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, " | 400 | printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, " |
407 | "hw_addr %pM\n", | 401 | "hw_addr %pM\n", |
408 | dev->name, ((info->flags & IS_AX88790) ? 7 : 1), | 402 | dev->name, ((info->flags & IS_AX88790) ? 7 : 1), |
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c index 278438beb915..5643f94541bc 100644 --- a/drivers/net/pcmcia/com20020_cs.c +++ b/drivers/net/pcmcia/com20020_cs.c | |||
@@ -122,7 +122,6 @@ static void com20020_detach(struct pcmcia_device *p_dev); | |||
122 | 122 | ||
123 | typedef struct com20020_dev_t { | 123 | typedef struct com20020_dev_t { |
124 | struct net_device *dev; | 124 | struct net_device *dev; |
125 | dev_node_t node; | ||
126 | } com20020_dev_t; | 125 | } com20020_dev_t; |
127 | 126 | ||
128 | /*====================================================================== | 127 | /*====================================================================== |
@@ -195,18 +194,16 @@ static void com20020_detach(struct pcmcia_device *link) | |||
195 | 194 | ||
196 | dev_dbg(&link->dev, "com20020_detach\n"); | 195 | dev_dbg(&link->dev, "com20020_detach\n"); |
197 | 196 | ||
198 | if (link->dev_node) { | 197 | dev_dbg(&link->dev, "unregister...\n"); |
199 | dev_dbg(&link->dev, "unregister...\n"); | ||
200 | 198 | ||
201 | unregister_netdev(dev); | 199 | unregister_netdev(dev); |
202 | 200 | ||
203 | /* | 201 | /* |
204 | * this is necessary because we register our IRQ separately | 202 | * this is necessary because we register our IRQ separately |
205 | * from card services. | 203 | * from card services. |
206 | */ | 204 | */ |
207 | if (dev->irq) | 205 | if (dev->irq) |
208 | free_irq(dev->irq, dev); | 206 | free_irq(dev->irq, dev); |
209 | } | ||
210 | 207 | ||
211 | com20020_release(link); | 208 | com20020_release(link); |
212 | 209 | ||
@@ -297,7 +294,6 @@ static int com20020_config(struct pcmcia_device *link) | |||
297 | lp->card_name = "PCMCIA COM20020"; | 294 | lp->card_name = "PCMCIA COM20020"; |
298 | lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */ | 295 | lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */ |
299 | 296 | ||
300 | link->dev_node = &info->node; | ||
301 | SET_NETDEV_DEV(dev, &link->dev); | 297 | SET_NETDEV_DEV(dev, &link->dev); |
302 | 298 | ||
303 | i = com20020_found(dev, 0); /* calls register_netdev */ | 299 | i = com20020_found(dev, 0); /* calls register_netdev */ |
@@ -305,12 +301,9 @@ static int com20020_config(struct pcmcia_device *link) | |||
305 | if (i != 0) { | 301 | if (i != 0) { |
306 | dev_printk(KERN_NOTICE, &link->dev, | 302 | dev_printk(KERN_NOTICE, &link->dev, |
307 | "com20020_cs: com20020_found() failed\n"); | 303 | "com20020_cs: com20020_found() failed\n"); |
308 | link->dev_node = NULL; | ||
309 | goto failed; | 304 | goto failed; |
310 | } | 305 | } |
311 | 306 | ||
312 | strcpy(info->node.dev_name, dev->name); | ||
313 | |||
314 | dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n", | 307 | dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n", |
315 | dev->name, dev->base_addr, dev->irq); | 308 | dev->name, dev->base_addr, dev->irq); |
316 | return 0; | 309 | return 0; |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 31f1a037737c..6580d78397d1 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -110,7 +110,6 @@ typedef enum { MBH10302, MBH10304, TDK, CONTEC, LA501, UNGERMANN, | |||
110 | */ | 110 | */ |
111 | typedef struct local_info_t { | 111 | typedef struct local_info_t { |
112 | struct pcmcia_device *p_dev; | 112 | struct pcmcia_device *p_dev; |
113 | dev_node_t node; | ||
114 | long open_time; | 113 | long open_time; |
115 | uint tx_started:1; | 114 | uint tx_started:1; |
116 | uint tx_queue; | 115 | uint tx_queue; |
@@ -274,8 +273,7 @@ static void fmvj18x_detach(struct pcmcia_device *link) | |||
274 | 273 | ||
275 | dev_dbg(&link->dev, "fmvj18x_detach\n"); | 274 | dev_dbg(&link->dev, "fmvj18x_detach\n"); |
276 | 275 | ||
277 | if (link->dev_node) | 276 | unregister_netdev(dev); |
278 | unregister_netdev(dev); | ||
279 | 277 | ||
280 | fmvj18x_release(link); | 278 | fmvj18x_release(link); |
281 | 279 | ||
@@ -523,17 +521,13 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
523 | } | 521 | } |
524 | 522 | ||
525 | lp->cardtype = cardtype; | 523 | lp->cardtype = cardtype; |
526 | link->dev_node = &lp->node; | ||
527 | SET_NETDEV_DEV(dev, &link->dev); | 524 | SET_NETDEV_DEV(dev, &link->dev); |
528 | 525 | ||
529 | if (register_netdev(dev) != 0) { | 526 | if (register_netdev(dev) != 0) { |
530 | printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); | 527 | printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); |
531 | link->dev_node = NULL; | ||
532 | goto failed; | 528 | goto failed; |
533 | } | 529 | } |
534 | 530 | ||
535 | strcpy(lp->node.dev_name, dev->name); | ||
536 | |||
537 | /* print current configuration */ | 531 | /* print current configuration */ |
538 | printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, " | 532 | printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, " |
539 | "hw_addr %pM\n", | 533 | "hw_addr %pM\n", |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index 0225cdffa4b9..2e42d80f8cae 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -104,7 +104,6 @@ static void ibmtr_detach(struct pcmcia_device *p_dev); | |||
104 | typedef struct ibmtr_dev_t { | 104 | typedef struct ibmtr_dev_t { |
105 | struct pcmcia_device *p_dev; | 105 | struct pcmcia_device *p_dev; |
106 | struct net_device *dev; | 106 | struct net_device *dev; |
107 | dev_node_t node; | ||
108 | window_handle_t sram_win_handle; | 107 | window_handle_t sram_win_handle; |
109 | struct tok_info *ti; | 108 | struct tok_info *ti; |
110 | } ibmtr_dev_t; | 109 | } ibmtr_dev_t; |
@@ -190,8 +189,7 @@ static void ibmtr_detach(struct pcmcia_device *link) | |||
190 | */ | 189 | */ |
191 | ti->sram_phys |= 1; | 190 | ti->sram_phys |= 1; |
192 | 191 | ||
193 | if (link->dev_node) | 192 | unregister_netdev(dev); |
194 | unregister_netdev(dev); | ||
195 | 193 | ||
196 | del_timer_sync(&(ti->tr_timer)); | 194 | del_timer_sync(&(ti->tr_timer)); |
197 | 195 | ||
@@ -289,18 +287,14 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
289 | Adapters Technical Reference" SC30-3585 for this info. */ | 287 | Adapters Technical Reference" SC30-3585 for this info. */ |
290 | ibmtr_hw_setup(dev, mmiobase); | 288 | ibmtr_hw_setup(dev, mmiobase); |
291 | 289 | ||
292 | link->dev_node = &info->node; | ||
293 | SET_NETDEV_DEV(dev, &link->dev); | 290 | SET_NETDEV_DEV(dev, &link->dev); |
294 | 291 | ||
295 | i = ibmtr_probe_card(dev); | 292 | i = ibmtr_probe_card(dev); |
296 | if (i != 0) { | 293 | if (i != 0) { |
297 | printk(KERN_NOTICE "ibmtr_cs: register_netdev() failed\n"); | 294 | printk(KERN_NOTICE "ibmtr_cs: register_netdev() failed\n"); |
298 | link->dev_node = NULL; | ||
299 | goto failed; | 295 | goto failed; |
300 | } | 296 | } |
301 | 297 | ||
302 | strcpy(info->node.dev_name, dev->name); | ||
303 | |||
304 | printk(KERN_INFO | 298 | printk(KERN_INFO |
305 | "%s: port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n", | 299 | "%s: port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n", |
306 | dev->name, dev->base_addr, dev->irq, | 300 | dev->name, dev->base_addr, dev->irq, |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index b779e3a0b4dd..d8a3b3cf246e 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -363,7 +363,6 @@ typedef struct _mace_statistics { | |||
363 | 363 | ||
364 | typedef struct _mace_private { | 364 | typedef struct _mace_private { |
365 | struct pcmcia_device *p_dev; | 365 | struct pcmcia_device *p_dev; |
366 | dev_node_t node; | ||
367 | struct net_device_stats linux_stats; /* Linux statistics counters */ | 366 | struct net_device_stats linux_stats; /* Linux statistics counters */ |
368 | mace_statistics mace_stats; /* MACE chip statistics counters */ | 367 | mace_statistics mace_stats; /* MACE chip statistics counters */ |
369 | 368 | ||
@@ -491,8 +490,7 @@ static void nmclan_detach(struct pcmcia_device *link) | |||
491 | 490 | ||
492 | dev_dbg(&link->dev, "nmclan_detach\n"); | 491 | dev_dbg(&link->dev, "nmclan_detach\n"); |
493 | 492 | ||
494 | if (link->dev_node) | 493 | unregister_netdev(dev); |
495 | unregister_netdev(dev); | ||
496 | 494 | ||
497 | nmclan_release(link); | 495 | nmclan_release(link); |
498 | 496 | ||
@@ -696,18 +694,14 @@ static int nmclan_config(struct pcmcia_device *link) | |||
696 | else | 694 | else |
697 | printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n"); | 695 | printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n"); |
698 | 696 | ||
699 | link->dev_node = &lp->node; | ||
700 | SET_NETDEV_DEV(dev, &link->dev); | 697 | SET_NETDEV_DEV(dev, &link->dev); |
701 | 698 | ||
702 | i = register_netdev(dev); | 699 | i = register_netdev(dev); |
703 | if (i != 0) { | 700 | if (i != 0) { |
704 | printk(KERN_NOTICE "nmclan_cs: register_netdev() failed\n"); | 701 | printk(KERN_NOTICE "nmclan_cs: register_netdev() failed\n"); |
705 | link->dev_node = NULL; | ||
706 | goto failed; | 702 | goto failed; |
707 | } | 703 | } |
708 | 704 | ||
709 | strcpy(lp->node.dev_name, dev->name); | ||
710 | |||
711 | printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port," | 705 | printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port," |
712 | " hw_addr %pM\n", | 706 | " hw_addr %pM\n", |
713 | dev->name, dev->base_addr, dev->irq, if_names[dev->if_port], | 707 | dev->name, dev->base_addr, dev->irq, if_names[dev->if_port], |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index af09be487577..6f77a768ba88 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -208,7 +208,6 @@ static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII }; | |||
208 | 208 | ||
209 | typedef struct pcnet_dev_t { | 209 | typedef struct pcnet_dev_t { |
210 | struct pcmcia_device *p_dev; | 210 | struct pcmcia_device *p_dev; |
211 | dev_node_t node; | ||
212 | u_int flags; | 211 | u_int flags; |
213 | void __iomem *base; | 212 | void __iomem *base; |
214 | struct timer_list watchdog; | 213 | struct timer_list watchdog; |
@@ -287,8 +286,7 @@ static void pcnet_detach(struct pcmcia_device *link) | |||
287 | 286 | ||
288 | dev_dbg(&link->dev, "pcnet_detach\n"); | 287 | dev_dbg(&link->dev, "pcnet_detach\n"); |
289 | 288 | ||
290 | if (link->dev_node) | 289 | unregister_netdev(dev); |
291 | unregister_netdev(dev); | ||
292 | 290 | ||
293 | pcnet_release(link); | 291 | pcnet_release(link); |
294 | 292 | ||
@@ -639,17 +637,13 @@ static int pcnet_config(struct pcmcia_device *link) | |||
639 | if (info->flags & (IS_DL10019|IS_DL10022)) | 637 | if (info->flags & (IS_DL10019|IS_DL10022)) |
640 | mii_phy_probe(dev); | 638 | mii_phy_probe(dev); |
641 | 639 | ||
642 | link->dev_node = &info->node; | ||
643 | SET_NETDEV_DEV(dev, &link->dev); | 640 | SET_NETDEV_DEV(dev, &link->dev); |
644 | 641 | ||
645 | if (register_netdev(dev) != 0) { | 642 | if (register_netdev(dev) != 0) { |
646 | printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n"); | 643 | printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n"); |
647 | link->dev_node = NULL; | ||
648 | goto failed; | 644 | goto failed; |
649 | } | 645 | } |
650 | 646 | ||
651 | strcpy(info->node.dev_name, dev->name); | ||
652 | |||
653 | if (info->flags & (IS_DL10019|IS_DL10022)) { | 647 | if (info->flags & (IS_DL10019|IS_DL10022)) { |
654 | u_char id = inb(dev->base_addr + 0x1a); | 648 | u_char id = inb(dev->base_addr + 0x1a); |
655 | printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ", | 649 | printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ", |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index ad061c7106b5..59796e7d09c4 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -103,7 +103,6 @@ struct smc_private { | |||
103 | u_short manfid; | 103 | u_short manfid; |
104 | u_short cardid; | 104 | u_short cardid; |
105 | 105 | ||
106 | dev_node_t node; | ||
107 | struct sk_buff *saved_skb; | 106 | struct sk_buff *saved_skb; |
108 | int packets_waiting; | 107 | int packets_waiting; |
109 | void __iomem *base; | 108 | void __iomem *base; |
@@ -323,7 +322,6 @@ static int smc91c92_probe(struct pcmcia_device *link) | |||
323 | return -ENOMEM; | 322 | return -ENOMEM; |
324 | smc = netdev_priv(dev); | 323 | smc = netdev_priv(dev); |
325 | smc->p_dev = link; | 324 | smc->p_dev = link; |
326 | link->priv = dev; | ||
327 | 325 | ||
328 | spin_lock_init(&smc->lock); | 326 | spin_lock_init(&smc->lock); |
329 | link->io.NumPorts1 = 16; | 327 | link->io.NumPorts1 = 16; |
@@ -361,8 +359,7 @@ static void smc91c92_detach(struct pcmcia_device *link) | |||
361 | 359 | ||
362 | dev_dbg(&link->dev, "smc91c92_detach\n"); | 360 | dev_dbg(&link->dev, "smc91c92_detach\n"); |
363 | 361 | ||
364 | if (link->dev_node) | 362 | unregister_netdev(dev); |
365 | unregister_netdev(dev); | ||
366 | 363 | ||
367 | smc91c92_release(link); | 364 | smc91c92_release(link); |
368 | 365 | ||
@@ -956,17 +953,13 @@ static int smc91c92_config(struct pcmcia_device *link) | |||
956 | SMC_SELECT_BANK(0); | 953 | SMC_SELECT_BANK(0); |
957 | } | 954 | } |
958 | 955 | ||
959 | link->dev_node = &smc->node; | ||
960 | SET_NETDEV_DEV(dev, &link->dev); | 956 | SET_NETDEV_DEV(dev, &link->dev); |
961 | 957 | ||
962 | if (register_netdev(dev) != 0) { | 958 | if (register_netdev(dev) != 0) { |
963 | printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n"); | 959 | printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n"); |
964 | link->dev_node = NULL; | ||
965 | goto config_undo; | 960 | goto config_undo; |
966 | } | 961 | } |
967 | 962 | ||
968 | strcpy(smc->node.dev_name, dev->name); | ||
969 | |||
970 | printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, " | 963 | printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, " |
971 | "hw_addr %pM\n", | 964 | "hw_addr %pM\n", |
972 | dev->name, name, (rev & 0x0f), dev->base_addr, dev->irq, | 965 | dev->name, name, (rev & 0x0f), dev->base_addr, dev->irq, |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index c9e7d7d47835..5e6b62ba8887 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -297,31 +297,9 @@ static void xirc2ps_detach(struct pcmcia_device *p_dev); | |||
297 | 297 | ||
298 | static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id); | 298 | static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id); |
299 | 299 | ||
300 | /**************** | ||
301 | * A linked list of "instances" of the device. Each actual | ||
302 | * PCMCIA card corresponds to one device instance, and is described | ||
303 | * by one struct pcmcia_device structure (defined in ds.h). | ||
304 | * | ||
305 | * You may not want to use a linked list for this -- for example, the | ||
306 | * memory card driver uses an array of struct pcmcia_device pointers, where minor | ||
307 | * device numbers are used to derive the corresponding array index. | ||
308 | */ | ||
309 | |||
310 | /**************** | ||
311 | * A driver needs to provide a dev_node_t structure for each device | ||
312 | * on a card. In some cases, there is only one device per card (for | ||
313 | * example, ethernet cards, modems). In other cases, there may be | ||
314 | * many actual or logical devices (SCSI adapters, memory cards with | ||
315 | * multiple partitions). The dev_node_t structures need to be kept | ||
316 | * in a linked list starting at the 'dev' field of a struct pcmcia_device | ||
317 | * structure. We allocate them in the card's private data structure, | ||
318 | * because they generally can't be allocated dynamically. | ||
319 | */ | ||
320 | |||
321 | typedef struct local_info_t { | 300 | typedef struct local_info_t { |
322 | struct net_device *dev; | 301 | struct net_device *dev; |
323 | struct pcmcia_device *p_dev; | 302 | struct pcmcia_device *p_dev; |
324 | dev_node_t node; | ||
325 | 303 | ||
326 | int card_type; | 304 | int card_type; |
327 | int probe_port; | 305 | int probe_port; |
@@ -579,8 +557,7 @@ xirc2ps_detach(struct pcmcia_device *link) | |||
579 | 557 | ||
580 | dev_dbg(&link->dev, "detach\n"); | 558 | dev_dbg(&link->dev, "detach\n"); |
581 | 559 | ||
582 | if (link->dev_node) | 560 | unregister_netdev(dev); |
583 | unregister_netdev(dev); | ||
584 | 561 | ||
585 | xirc2ps_release(link); | 562 | xirc2ps_release(link); |
586 | 563 | ||
@@ -985,17 +962,13 @@ xirc2ps_config(struct pcmcia_device * link) | |||
985 | if (local->dingo) | 962 | if (local->dingo) |
986 | do_reset(dev, 1); /* a kludge to make the cem56 work */ | 963 | do_reset(dev, 1); /* a kludge to make the cem56 work */ |
987 | 964 | ||
988 | link->dev_node = &local->node; | ||
989 | SET_NETDEV_DEV(dev, &link->dev); | 965 | SET_NETDEV_DEV(dev, &link->dev); |
990 | 966 | ||
991 | if ((err=register_netdev(dev))) { | 967 | if ((err=register_netdev(dev))) { |
992 | printk(KNOT_XIRC "register_netdev() failed\n"); | 968 | printk(KNOT_XIRC "register_netdev() failed\n"); |
993 | link->dev_node = NULL; | ||
994 | goto config_error; | 969 | goto config_error; |
995 | } | 970 | } |
996 | 971 | ||
997 | strcpy(local->node.dev_name, dev->name); | ||
998 | |||
999 | /* give some infos about the hardware */ | 972 | /* give some infos about the hardware */ |
1000 | printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %pM\n", | 973 | printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %pM\n", |
1001 | dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq, | 974 | dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq, |