aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/aha152x_stub.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/scsi/pcmcia/aha152x_stub.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/scsi/pcmcia/aha152x_stub.c')
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index e7f9d26a0d7c..7fbef1e51685 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)
251 pcmcia_disable_device(link->handle); 251 pcmcia_disable_device(link->handle);
252} 252}
253 253
254static int aha152x_suspend(struct pcmcia_device *dev)
255{
256 dev_link_t *link = dev_to_instance(dev);
257
258 link->state |= DEV_SUSPEND;
259 if (link->state & DEV_CONFIG)
260 pcmcia_release_configuration(link->handle);
261
262 return 0;
263}
264
265static int aha152x_resume(struct pcmcia_device *dev) 254static int aha152x_resume(struct pcmcia_device *dev)
266{ 255{
267 dev_link_t *link = dev_to_instance(dev); 256 dev_link_t *link = dev_to_instance(dev);
268 scsi_info_t *info = link->priv; 257 scsi_info_t *info = link->priv;
269 258
270 link->state &= ~DEV_SUSPEND; 259 aha152x_host_reset_host(info->host);
271 if (link->state & DEV_CONFIG) {
272 pcmcia_request_configuration(link->handle, &link->conf);
273 aha152x_host_reset_host(info->host);
274 }
275 260
276 return 0; 261 return 0;
277} 262}
@@ -294,7 +279,6 @@ static struct pcmcia_driver aha152x_cs_driver = {
294 .probe = aha152x_attach, 279 .probe = aha152x_attach,
295 .remove = aha152x_detach, 280 .remove = aha152x_detach,
296 .id_table = aha152x_ids, 281 .id_table = aha152x_ids,
297 .suspend = aha152x_suspend,
298 .resume = aha152x_resume, 282 .resume = aha152x_resume,
299}; 283};
300 284