aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl3501_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl3501_cs.c')
-rw-r--r--drivers/net/wireless/wl3501_cs.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 7b9621de239f..5e5d24c1ce2b 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1451,6 +1451,8 @@ static void wl3501_detach(struct pcmcia_device *link)
1451 netif_device_detach(dev); 1451 netif_device_detach(dev);
1452 wl3501_release(link); 1452 wl3501_release(link);
1453 1453
1454 unregister_netdev(dev);
1455
1454 if (link->priv) 1456 if (link->priv)
1455 free_netdev(link->priv); 1457 free_netdev(link->priv);
1456 1458
@@ -1897,10 +1899,6 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
1897 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1899 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
1898 p_dev->io.IOAddrLines = 5; 1900 p_dev->io.IOAddrLines = 5;
1899 1901
1900 /* Interrupt setup */
1901 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
1902 p_dev->irq.Handler = wl3501_interrupt;
1903
1904 /* General socket configuration */ 1902 /* General socket configuration */
1905 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 1903 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
1906 p_dev->conf.IntType = INT_MEMORY_AND_IO; 1904 p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -1961,7 +1959,7 @@ static int wl3501_config(struct pcmcia_device *link)
1961 /* Now allocate an interrupt line. Note that this does not actually 1959 /* Now allocate an interrupt line. Note that this does not actually
1962 * assign a handler to the interrupt. */ 1960 * assign a handler to the interrupt. */
1963 1961
1964 ret = pcmcia_request_irq(link, &link->irq); 1962 ret = pcmcia_request_irq(link, wl3501_interrupt);
1965 if (ret) 1963 if (ret)
1966 goto failed; 1964 goto failed;
1967 1965
@@ -1972,7 +1970,7 @@ static int wl3501_config(struct pcmcia_device *link)
1972 if (ret) 1970 if (ret)
1973 goto failed; 1971 goto failed;
1974 1972
1975 dev->irq = link->irq.AssignedIRQ; 1973 dev->irq = link->irq;
1976 dev->base_addr = link->io.BasePort1; 1974 dev->base_addr = link->io.BasePort1;
1977 SET_NETDEV_DEV(dev, &link->dev); 1975 SET_NETDEV_DEV(dev, &link->dev);
1978 if (register_netdev(dev)) { 1976 if (register_netdev(dev)) {
@@ -1981,20 +1979,15 @@ static int wl3501_config(struct pcmcia_device *link)
1981 } 1979 }
1982 1980
1983 this = netdev_priv(dev); 1981 this = netdev_priv(dev);
1984 /*
1985 * At this point, the dev_node_t structure(s) should be initialized and
1986 * arranged in a linked list at link->dev_node.
1987 */
1988 link->dev_node = &this->node;
1989 1982
1990 this->base_addr = dev->base_addr; 1983 this->base_addr = dev->base_addr;
1991 1984
1992 if (!wl3501_get_flash_mac_addr(this)) { 1985 if (!wl3501_get_flash_mac_addr(this)) {
1993 printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n", 1986 printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n",
1994 dev->name); 1987 dev->name);
1988 unregister_netdev(dev);
1995 goto failed; 1989 goto failed;
1996 } 1990 }
1997 strcpy(this->node.dev_name, dev->name);
1998 1991
1999 for (i = 0; i < 6; i++) 1992 for (i = 0; i < 6; i++)
2000 dev->dev_addr[i] = ((char *)&this->mac_addr)[i]; 1993 dev->dev_addr[i] = ((char *)&this->mac_addr)[i];
@@ -2038,12 +2031,6 @@ failed:
2038 */ 2031 */
2039static void wl3501_release(struct pcmcia_device *link) 2032static void wl3501_release(struct pcmcia_device *link)
2040{ 2033{
2041 struct net_device *dev = link->priv;
2042
2043 /* Unlink the device chain */
2044 if (link->dev_node)
2045 unregister_netdev(dev);
2046
2047 pcmcia_disable_device(link); 2034 pcmcia_disable_device(link);
2048} 2035}
2049 2036