VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / net / pcmcia / xirc2ps_cs.c
index d4cc269..5be2ba3 100644 (file)
@@ -668,6 +668,9 @@ xirc2ps_detach(dev_link_t * link)
        return;
     }
 
+    if (link->dev)
+       unregister_netdev(dev);
+
     /*
      * If the device is currently configured and active, we won't
      * actually delete it yet. Instead, it is marked so that when
@@ -683,8 +686,6 @@ xirc2ps_detach(dev_link_t * link)
 
     /* Unlink device structure, free it */
     *linkp = link->next;
-    if (link->dev)
-       unregister_netdev(dev);
     free_netdev(dev);
 } /* xirc2ps_detach */
 
@@ -814,7 +815,7 @@ xirc2ps_config(dev_link_t * link)
     cistpl_lan_node_id_t *node_id = (cistpl_lan_node_id_t*)parse.funce.data;
     cistpl_cftable_entry_t *cf = &parse.cftable_entry;
 
-    local->dingo_ccr = 0;
+    local->dingo_ccr = NULL;
 
     DEBUG(0, "config(0x%p)\n", link);
 
@@ -1203,10 +1204,8 @@ xirc2ps_event(event_t event, int priority,
        break;
     case CS_EVENT_CARD_REMOVAL:
        link->state &= ~DEV_PRESENT;
-       if (link->state & DEV_CONFIG) {
+       if (link->state & DEV_CONFIG)
            netif_device_detach(dev);
-           xirc2ps_release(link);
-       }
        break;
     case CS_EVENT_CARD_INSERTION:
        link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;