summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia
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/scsi/pcmcia
parent50db3fdbbc98260fb538c1cc3f8cc597ba7bffe7 (diff)
downloadop-kernel-dev-8661bb5b4af1849c1f5a4e80c4e275fd13c155d6.zip
op-kernel-dev-8661bb5b4af1849c1f5a4e80c4e275fd13c155d6.tar.gz
[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/scsi/pcmcia')
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c18
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c17
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c10
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c13
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c15
5 files changed, 2 insertions, 71 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index e7f9d26..7fbef1e 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -251,27 +251,12 @@ static void aha152x_release_cs(dev_link_t *link)
pcmcia_disable_device(link->handle);
}
-static int aha152x_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 aha152x_resume(struct pcmcia_device *dev)
{
dev_link_t *link = dev_to_instance(dev);
scsi_info_t *info = link->priv;
- link->state &= ~DEV_SUSPEND;
- if (link->state & DEV_CONFIG) {
- pcmcia_request_configuration(link->handle, &link->conf);
- aha152x_host_reset_host(info->host);
- }
+ aha152x_host_reset_host(info->host);
return 0;
}
@@ -294,7 +279,6 @@ static struct pcmcia_driver aha152x_cs_driver = {
.probe = aha152x_attach,
.remove = aha152x_detach,
.id_table = aha152x_ids,
- .suspend = aha152x_suspend,
.resume = aha152x_resume,
};
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index fb7221c..20b9b27 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -220,26 +220,12 @@ static void fdomain_release(dev_link_t *link)
/*====================================================================*/
-static int fdomain_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 fdomain_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);
+ if (link->state & DEV_CONFIG)
fdomain_16x0_bus_reset(NULL);
- }
return 0;
}
@@ -260,7 +246,6 @@ static struct pcmcia_driver fdomain_cs_driver = {
.probe = fdomain_attach,
.remove = fdomain_detach,
.id_table = fdomain_ids,
- .suspend = fdomain_suspend,
.resume = fdomain_resume,
};
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index d469e0d..e313b40 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1987,8 +1987,6 @@ static int nsp_cs_suspend(struct pcmcia_device *dev)
scsi_info_t *info = link->priv;
nsp_hw_data *data;
- link->state |= DEV_SUSPEND;
-
nsp_dbg(NSP_DEBUG_INIT, "event: suspend");
if (info->host != NULL) {
@@ -2001,9 +1999,6 @@ static int nsp_cs_suspend(struct pcmcia_device *dev)
info->stop = 1;
- if (link->state & DEV_CONFIG)
- pcmcia_release_configuration(link->handle);
-
return 0;
}
@@ -2015,11 +2010,6 @@ static int nsp_cs_resume(struct pcmcia_device *dev)
nsp_dbg(NSP_DEBUG_INIT, "event: resume");
- link->state &= ~DEV_SUSPEND;
-
- if (link->state & DEV_CONFIG)
- pcmcia_request_configuration(link->handle, &link->conf);
-
info->stop = 0;
if (info->host != NULL) {
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 1e27059..5a8da51 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -311,22 +311,10 @@ static void qlogic_release(dev_link_t *link)
/*====================================================================*/
-static int qlogic_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 qlogic_resume(struct pcmcia_device *dev)
{
dev_link_t *link = dev_to_instance(dev);
- link->state &= ~DEV_SUSPEND;
if (link->state & DEV_CONFIG) {
scsi_info_t *info = link->priv;
@@ -375,7 +363,6 @@ static struct pcmcia_driver qlogic_cs_driver = {
.probe = qlogic_attach,
.remove = qlogic_detach,
.id_table = qlogic_ids,
- .suspend = qlogic_suspend,
.resume = qlogic_resume,
};
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index 42d002b..4a69885 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -857,26 +857,12 @@ cs_failed:
return;
} /* SYM53C500_config */
-static int sym53c500_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 sym53c500_resume(struct pcmcia_device *dev)
{
dev_link_t *link = dev_to_instance(dev);
struct scsi_info_t *info = link->priv;
- link->state &= ~DEV_SUSPEND;
if (link->state & DEV_CONFIG) {
- pcmcia_request_configuration(link->handle, &link->conf);
-
/* See earlier comment about manufacturer IDs. */
if ((info->manf_id == MANFID_MACNICA) ||
(info->manf_id == MANFID_PIONEER) ||
@@ -963,7 +949,6 @@ static struct pcmcia_driver sym53c500_cs_driver = {
.probe = SYM53C500_attach,
.remove = SYM53C500_detach,
.id_table = sym53c500_ids,
- .suspend = sym53c500_suspend,
.resume = sym53c500_resume,
};
OpenPOWER on IntegriCloud