Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
[safe/jmp/linux-2.6] / drivers / net / wireless / wl3501_cs.c
index 6449fe3..376c6b9 100644 (file)
@@ -1450,6 +1450,8 @@ static void wl3501_detach(struct pcmcia_device *link)
        netif_device_detach(dev);
        wl3501_release(link);
 
+       unregister_netdev(dev);
+
        if (link->priv)
                free_netdev(link->priv);
 }
@@ -1894,10 +1896,6 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
        p_dev->io.Attributes1   = IO_DATA_PATH_WIDTH_8;
        p_dev->io.IOAddrLines   = 5;
 
-       /* Interrupt setup */
-       p_dev->irq.Attributes   = IRQ_TYPE_DYNAMIC_SHARING;
-       p_dev->irq.Handler = wl3501_interrupt;
-
        /* General socket configuration */
        p_dev->conf.Attributes  = CONF_ENABLE_IRQ;
        p_dev->conf.IntType     = INT_MEMORY_AND_IO;
@@ -1958,7 +1956,7 @@ static int wl3501_config(struct pcmcia_device *link)
        /* Now allocate an interrupt line. Note that this does not actually
         * assign a handler to the interrupt. */
 
-       ret = pcmcia_request_irq(link, &link->irq);
+       ret = pcmcia_request_irq(link, wl3501_interrupt);
        if (ret)
                goto failed;
 
@@ -1969,7 +1967,7 @@ static int wl3501_config(struct pcmcia_device *link)
        if (ret)
                goto failed;
 
-       dev->irq = link->irq.AssignedIRQ;
+       dev->irq = link->irq;
        dev->base_addr = link->io.BasePort1;
        SET_NETDEV_DEV(dev, &link->dev);
        if (register_netdev(dev)) {
@@ -1978,20 +1976,15 @@ static int wl3501_config(struct pcmcia_device *link)
        }
 
        this = netdev_priv(dev);
-       /*
-        * At this point, the dev_node_t structure(s) should be initialized and
-        * arranged in a linked list at link->dev_node.
-        */
-       link->dev_node = &this->node;
 
        this->base_addr = dev->base_addr;
 
        if (!wl3501_get_flash_mac_addr(this)) {
                printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n",
                       dev->name);
+               unregister_netdev(dev);
                goto failed;
        }
-       strcpy(this->node.dev_name, dev->name);
 
        for (i = 0; i < 6; i++)
                dev->dev_addr[i] = ((char *)&this->mac_addr)[i];
@@ -2035,12 +2028,6 @@ failed:
  */
 static void wl3501_release(struct pcmcia_device *link)
 {
-       struct net_device *dev = link->priv;
-
-       /* Unlink the device chain */
-       if (link->dev_node)
-               unregister_netdev(dev);
-
        pcmcia_disable_device(link);
 }