]> err.no Git - linux-2.6/commitdiff
[PATCH] orinoco: simplify locking, fix error handling in PCMCIA resume
authorPavel Roskin <proski@gnu.org>
Mon, 1 May 2006 06:13:28 +0000 (02:13 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 5 May 2006 21:10:40 +0000 (17:10 -0400)
Don't use flags in the spinlocks - the PCMCIA resume functions may not
be called under lock.  Don't ignore any errors.

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 1c19c76d47af08d10cc184edf97cbfa66fb8e97a..b2aec4d9fbb12b3dc759233564722ac43975daf5 100644 (file)
@@ -415,7 +415,6 @@ static int orinoco_cs_resume(struct pcmcia_device *link)
        struct orinoco_private *priv = netdev_priv(dev);
        struct orinoco_pccard *card = priv->card;
        int err = 0;
-       unsigned long flags;
 
        if (! test_bit(0, &card->hard_reset_in_progress)) {
                err = orinoco_reinit_firmware(dev);
@@ -425,7 +424,7 @@ static int orinoco_cs_resume(struct pcmcia_device *link)
                        return -EIO;
                }
 
-               spin_lock_irqsave(&priv->lock, flags);
+               spin_lock(&priv->lock);
 
                netif_device_attach(dev);
                priv->hw_unavailable--;
@@ -437,10 +436,10 @@ static int orinoco_cs_resume(struct pcmcia_device *link)
                                       dev->name, err);
                }
 
-               spin_unlock_irqrestore(&priv->lock, flags);
+               spin_unlock(&priv->lock);
        }
 
-       return 0;
+       return err;
 }
 
 
index e9172eebfd01594e85f7020d5e3339547843f889..7f9aa139c3475fb11e526433fd85566ada350c48 100644 (file)
@@ -866,11 +866,10 @@ spectrum_cs_suspend(struct pcmcia_device *link)
 {
        struct net_device *dev = link->priv;
        struct orinoco_private *priv = netdev_priv(dev);
-       unsigned long flags;
        int err = 0;
 
        /* Mark the device as stopped, to block IO until later */
-       spin_lock_irqsave(&priv->lock, flags);
+       spin_lock(&priv->lock);
 
        err = __orinoco_down(dev);
        if (err)
@@ -880,9 +879,9 @@ spectrum_cs_suspend(struct pcmcia_device *link)
        netif_device_detach(dev);
        priv->hw_unavailable++;
 
-       spin_unlock_irqrestore(&priv->lock, flags);
+       spin_unlock(&priv->lock);
 
-       return 0;
+       return err;
 }
 
 static int