summaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-02 00:02:33 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 17:15:52 +0200
commit8661bb5b4af1849c1f5a4e80c4e275fd13c155d6 (patch)
treead99d85ea8d6f5c4c99b93f869bfd412994fb4ee /drivers/isdn
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/isdn')
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c38
-rw-r--r--drivers/isdn/hisax/avma1_cs.c26
-rw-r--r--drivers/isdn/hisax/elsa_cs.c6
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c6
-rw-r--r--drivers/isdn/hisax/teles_cs.c6
5 files changed, 1 insertions, 81 deletions
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index 5f70661994d..ae70247d515 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -371,42 +371,6 @@ static void avmcs_release(dev_link_t *link)
pcmcia_disable_device(link->handle);
} /* avmcs_release */
-static int avmcs_suspend(struct pcmcia_device *dev)
-{
- dev_link_t *link = dev_to_instance(dev);
-
- link->state |= DEV_SUSPEND;
- if (link->state & DEV_CONFIG)
- pcmcia_release_configuration(link->handle);
-
- return 0;
-}
-
-static int avmcs_resume(struct pcmcia_device *dev)
-{
- dev_link_t *link = dev_to_instance(dev);
-
- link->state &= ~DEV_SUSPEND;
- if (link->state & DEV_CONFIG)
- pcmcia_request_configuration(link->handle, &link->conf);
-
- return 0;
-}
-
-/*======================================================================
-
- The card status event handler. Mostly, this schedules other
- stuff to run after an event is received. A CARD_REMOVAL event
- also sets some flags to discourage the net drivers from trying
- to talk to the card any more.
-
- When a CARD_REMOVAL event is received, we immediately set a flag
- to block future accesses to this device. All the functions that
- actually access the device should check this flag to make sure
- the card is still present.
-
-======================================================================*/
-
static struct pcmcia_device_id avmcs_ids[] = {
PCMCIA_DEVICE_PROD_ID12("AVM", "ISDN-Controller B1", 0x95d42008, 0x845dc335),
@@ -424,8 +388,6 @@ static struct pcmcia_driver avmcs_driver = {
.probe = avmcs_attach,
.remove = avmcs_detach,
.id_table = avmcs_ids,
- .suspend= avmcs_suspend,
- .resume = avmcs_resume,
};
static int __init avmcs_init(void)
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 845fa14e1ba..5e847cfb96f 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -383,28 +383,6 @@ static void avma1cs_release(dev_link_t *link)
pcmcia_disable_device(link->handle);
} /* avma1cs_release */
-static int avma1cs_suspend(struct pcmcia_device *dev)
-{
- dev_link_t *link = dev_to_instance(dev);
-
- link->state |= DEV_SUSPEND;
- if (link->state & DEV_CONFIG)
- pcmcia_release_configuration(link->handle);
-
- return 0;
-}
-
-static int avma1cs_resume(struct pcmcia_device *dev)
-{
- dev_link_t *link = dev_to_instance(dev);
-
- link->state &= ~DEV_SUSPEND;
- if (link->state & DEV_CONFIG)
- pcmcia_request_configuration(link->handle, &link->conf);
-
- return 0;
-}
-
static struct pcmcia_device_id avma1cs_ids[] = {
PCMCIA_DEVICE_PROD_ID12("AVM", "ISDN A", 0x95d42008, 0xadc9d4bb),
@@ -421,10 +399,8 @@ static struct pcmcia_driver avma1cs_driver = {
.probe = avma1cs_attach,
.remove = avma1cs_detach,
.id_table = avma1cs_ids,
- .suspend = avma1cs_suspend,
- .resume = avma1cs_resume,
};
-
+
/*====================================================================*/
static int __init init_avma1_cs(void)
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index 60c75c7c016..b76b303ebf6 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -389,10 +389,7 @@ static int elsa_suspend(struct pcmcia_device *p_dev)
dev_link_t *link = dev_to_instance(p_dev);
local_info_t *dev = link->priv;
- link->state |= DEV_SUSPEND;
dev->busy = 1;
- if (link->state & DEV_CONFIG)
- pcmcia_release_configuration(link->handle);
return 0;
}
@@ -402,9 +399,6 @@ static int elsa_resume(struct pcmcia_device *p_dev)
dev_link_t *link = dev_to_instance(p_dev);
local_info_t *dev = link->priv;
- link->state &= ~DEV_SUSPEND;
- if (link->state & DEV_CONFIG)
- pcmcia_request_configuration(link->handle, &link->conf);
dev->busy = 0;
return 0;
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index fd0f127e40b..5745eb1afe3 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -472,10 +472,7 @@ static int sedlbauer_suspend(struct pcmcia_device *p_dev)
dev_link_t *link = dev_to_instance(p_dev);
local_info_t *dev = link->priv;
- link->state |= DEV_SUSPEND;
dev->stop = 1;
- if (link->state & DEV_CONFIG)
- pcmcia_release_configuration(link->handle);
return 0;
}
@@ -485,9 +482,6 @@ static int sedlbauer_resume(struct pcmcia_device *p_dev)
dev_link_t *link = dev_to_instance(p_dev);
local_info_t *dev = link->priv;
- link->state &= ~DEV_SUSPEND;
- if (link->state & DEV_CONFIG)
- pcmcia_request_configuration(link->handle, &link->conf);
dev->stop = 0;
return 0;
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index 7945fd64621..929507eb63a 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -380,10 +380,7 @@ static int teles_suspend(struct pcmcia_device *p_dev)
dev_link_t *link = dev_to_instance(p_dev);
local_info_t *dev = link->priv;
- link->state |= DEV_SUSPEND;
dev->busy = 1;
- if (link->state & DEV_CONFIG)
- pcmcia_release_configuration(link->handle);
return 0;
}
@@ -393,9 +390,6 @@ static int teles_resume(struct pcmcia_device *p_dev)
dev_link_t *link = dev_to_instance(p_dev);
local_info_t *dev = link->priv;
- link->state &= ~DEV_SUSPEND;
- if (link->state & DEV_CONFIG)
- pcmcia_request_configuration(link->handle, &link->conf);
dev->busy = 0;
return 0;