aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/xirc2ps_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-03-20 14:39:26 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-05-10 04:23:16 -0400
commitc7c2fa079073ab92b0736a161b4cf1051a3e631f (patch)
treec23bb2e89f68601e5c37a1a0df9e83c9e71f9dd6 /drivers/net/pcmcia/xirc2ps_cs.c
parentded6a1a341cb38c4cfeb09d3d01ffe16b5c804b3 (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/xirc2ps_cs.c')
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c29
1 files changed, 1 insertions, 28 deletions
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
298static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id); 298static 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
321typedef struct local_info_t { 300typedef 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,