[PATCH] orinoco: unregister network device before releasing PCMCIA resources
authorPavel Roskin <proski@gnu.org>
Mon, 1 May 2006 06:13:24 +0000 (02:13 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 5 May 2006 21:10:40 +0000 (17:10 -0400)
Hardware resources should not be made available to other devices while
the network device is still registered.  Also remove the related debug
statements.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/orinoco_cs.c
drivers/net/wireless/spectrum_cs.c

index d2c48ac60f4658ebeebfb26be371fc1bbbe5365a..ee05ec6eda9d8bdfdc4770e7a274e1b1e1878863 100644 (file)
@@ -147,14 +147,11 @@ static void orinoco_cs_detach(struct pcmcia_device *link)
 {
        struct net_device *dev = link->priv;
 
+       if (link->dev_node)
+               unregister_netdev(dev);
+
        orinoco_cs_release(link);
 
-       DEBUG(0, PFX "detach: link=%p link->dev_node=%p\n", link, link->dev_node);
-       if (link->dev_node) {
-               DEBUG(0, PFX "About to unregister net device %p\n",
-                     dev);
-               unregister_netdev(dev);
-       }
        free_orinocodev(dev);
 }                              /* orinoco_cs_detach */
 
index aeb38d9388327c23101f8bb87d62e67ab4a7f96c..0921162097fe6346967350aed910cb3e4c8848be 100644 (file)
@@ -625,14 +625,11 @@ static void spectrum_cs_detach(struct pcmcia_device *link)
 {
        struct net_device *dev = link->priv;
 
+       if (link->dev_node)
+               unregister_netdev(dev);
+
        spectrum_cs_release(link);
 
-       DEBUG(0, PFX "detach: link=%p link->dev_node=%p\n", link, link->dev_node);
-       if (link->dev_node) {
-               DEBUG(0, PFX "About to unregister net device %p\n",
-                     dev);
-               unregister_netdev(dev);
-       }
        free_orinocodev(dev);
 }                              /* spectrum_cs_detach */