aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/com20020_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-01 18:02:33 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:15:52 -0500
commit8661bb5b4af1849c1f5a4e80c4e275fd13c155d6 (patch)
treead99d85ea8d6f5c4c99b93f869bfd412994fb4ee /drivers/net/pcmcia/com20020_cs.c
parent50db3fdbbc98260fb538c1cc3f8cc597ba7bffe7 (diff)
[PATCH] pcmcia: default suspend and resume handling
In all but one case, the suspend and resume functions of PCMCIA drivers contain mostly of calls to pcmcia_release_configuration() and pcmcia_request_configuration(). Therefore, move this code out of the drivers and into the core. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia/com20020_cs.c')
-rw-r--r--drivers/net/pcmcia/com20020_cs.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index a0ec5e7aacc6..0748c3d49544 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -387,13 +387,8 @@ static int com20020_suspend(struct pcmcia_device *p_dev)
387 com20020_dev_t *info = link->priv; 387 com20020_dev_t *info = link->priv;
388 struct net_device *dev = info->dev; 388 struct net_device *dev = info->dev;
389 389
390 link->state |= DEV_SUSPEND; 390 if ((link->state & DEV_CONFIG) && (link->open))
391 if (link->state & DEV_CONFIG) { 391 netif_device_detach(dev);
392 if (link->open) {
393 netif_device_detach(dev);
394 }
395 pcmcia_release_configuration(link->handle);
396 }
397 392
398 return 0; 393 return 0;
399} 394}
@@ -404,15 +399,11 @@ static int com20020_resume(struct pcmcia_device *p_dev)
404 com20020_dev_t *info = link->priv; 399 com20020_dev_t *info = link->priv;
405 struct net_device *dev = info->dev; 400 struct net_device *dev = info->dev;
406 401
407 link->state &= ~DEV_SUSPEND; 402 if ((link->state & DEV_CONFIG) && (link->open)) {
408 if (link->state & DEV_CONFIG) { 403 int ioaddr = dev->base_addr;
409 pcmcia_request_configuration(link->handle, &link->conf); 404 struct arcnet_local *lp = dev->priv;
410 if (link->open) { 405 ARCRESET;
411 int ioaddr = dev->base_addr; 406 }
412 struct arcnet_local *lp = dev->priv;
413 ARCRESET;
414 }
415 }
416 407
417 return 0; 408 return 0;
418} 409}