summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/orinoco/spectrum_cs.c
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2009-06-18 22:21:30 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 19:01:46 (GMT)
commit6415f7df10573bf1ec42644f42bef565127114a1 (patch)
tree6aa981f181010faca22989ffd70ef89b0d32ff07 /drivers/net/wireless/orinoco/spectrum_cs.c
parentef96b5c9ed6ba4b45fd4cf45810c34978bb8d8bb (diff)
downloadlinux-fsl-qoriq-6415f7df10573bf1ec42644f42bef565127114a1.tar.xz
orinoco: Handle suspend/restore in core driver
Each device does almost exactly the same things on suspend and resume when upping and downing the interface. So move this logic into a common routine. Signed-off-by: David Kilroy <kilroyd@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco/spectrum_cs.c')
-rw-r--r--drivers/net/wireless/orinoco/spectrum_cs.c41
1 files changed, 3 insertions, 38 deletions
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index 7b4a7e4..c361310 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -421,22 +421,10 @@ static int
spectrum_cs_suspend(struct pcmcia_device *link)
{
struct orinoco_private *priv = link->priv;
- struct net_device *dev = priv->ndev;
- unsigned long flags;
int err = 0;
/* Mark the device as stopped, to block IO until later */
- spin_lock_irqsave(&priv->lock, flags);
-
- err = __orinoco_down(priv);
- if (err)
- printk(KERN_WARNING "%s: Error %d downing interface\n",
- dev->name, err);
-
- netif_device_detach(dev);
- priv->hw_unavailable++;
-
- spin_unlock_irqrestore(&priv->lock, flags);
+ orinoco_down(priv);
return err;
}
@@ -445,32 +433,9 @@ static int
spectrum_cs_resume(struct pcmcia_device *link)
{
struct orinoco_private *priv = link->priv;
- struct net_device *dev = priv->ndev;
- unsigned long flags;
- int err;
-
- err = orinoco_reinit_firmware(priv);
- if (err) {
- printk(KERN_ERR "%s: Error %d re-initializing firmware\n",
- dev->name, err);
- return -EIO;
- }
+ int err = orinoco_up(priv);
- spin_lock_irqsave(&priv->lock, flags);
-
- netif_device_attach(dev);
- priv->hw_unavailable--;
-
- if (priv->open && !priv->hw_unavailable) {
- err = __orinoco_up(priv);
- if (err)
- printk(KERN_ERR "%s: Error %d restarting card\n",
- dev->name, err);
- }
-
- spin_unlock_irqrestore(&priv->lock, flags);
-
- return 0;
+ return err;
}