diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-01 18:02:33 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:15:52 -0500 |
commit | 8661bb5b4af1849c1f5a4e80c4e275fd13c155d6 (patch) | |
tree | ad99d85ea8d6f5c4c99b93f869bfd412994fb4ee /sound | |
parent | 50db3fdbbc98260fb538c1cc3f8cc597ba7bffe7 (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 'sound')
-rw-r--r-- | sound/pcmcia/pdaudiocf/pdaudiocf.c | 10 | ||||
-rw-r--r-- | sound/pcmcia/vx/vxpocket.c | 9 |
2 files changed, 0 insertions, 19 deletions
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index 80c53553b815..31f4bdc46ce6 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c | |||
@@ -284,16 +284,11 @@ static int pdacf_suspend(struct pcmcia_device *dev) | |||
284 | struct snd_pdacf *chip = link->priv; | 284 | struct snd_pdacf *chip = link->priv; |
285 | 285 | ||
286 | snd_printdd(KERN_DEBUG "SUSPEND\n"); | 286 | snd_printdd(KERN_DEBUG "SUSPEND\n"); |
287 | link->state |= DEV_SUSPEND; | ||
288 | if (chip) { | 287 | if (chip) { |
289 | snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n"); | 288 | snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n"); |
290 | snd_pdacf_suspend(chip, PMSG_SUSPEND); | 289 | snd_pdacf_suspend(chip, PMSG_SUSPEND); |
291 | } | 290 | } |
292 | 291 | ||
293 | snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n"); | ||
294 | if (link->state & DEV_CONFIG) | ||
295 | pcmcia_release_configuration(link->handle); | ||
296 | |||
297 | return 0; | 292 | return 0; |
298 | } | 293 | } |
299 | 294 | ||
@@ -303,12 +298,7 @@ static int pdacf_resume(struct pcmcia_device *dev) | |||
303 | struct snd_pdacf *chip = link->priv; | 298 | struct snd_pdacf *chip = link->priv; |
304 | 299 | ||
305 | snd_printdd(KERN_DEBUG "RESUME\n"); | 300 | snd_printdd(KERN_DEBUG "RESUME\n"); |
306 | link->state &= ~DEV_SUSPEND; | ||
307 | |||
308 | snd_printdd(KERN_DEBUG "CARD_RESET\n"); | ||
309 | if (DEV_OK(link)) { | 301 | if (DEV_OK(link)) { |
310 | snd_printdd(KERN_DEBUG "requestconfig...\n"); | ||
311 | pcmcia_request_configuration(link->handle, &link->conf); | ||
312 | if (chip) { | 302 | if (chip) { |
313 | snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n"); | 303 | snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n"); |
314 | snd_pdacf_resume(chip); | 304 | snd_pdacf_resume(chip); |
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 8093e5044956..e101e05afac3 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c | |||
@@ -284,14 +284,10 @@ static int vxp_suspend(struct pcmcia_device *dev) | |||
284 | struct vx_core *chip = link->priv; | 284 | struct vx_core *chip = link->priv; |
285 | 285 | ||
286 | snd_printdd(KERN_DEBUG "SUSPEND\n"); | 286 | snd_printdd(KERN_DEBUG "SUSPEND\n"); |
287 | link->state |= DEV_SUSPEND; | ||
288 | if (chip) { | 287 | if (chip) { |
289 | snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n"); | 288 | snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n"); |
290 | snd_vx_suspend(chip, PMSG_SUSPEND); | 289 | snd_vx_suspend(chip, PMSG_SUSPEND); |
291 | } | 290 | } |
292 | snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n"); | ||
293 | if (link->state & DEV_CONFIG) | ||
294 | pcmcia_release_configuration(link->handle); | ||
295 | 291 | ||
296 | return 0; | 292 | return 0; |
297 | } | 293 | } |
@@ -302,13 +298,8 @@ static int vxp_resume(struct pcmcia_device *dev) | |||
302 | struct vx_core *chip = link->priv; | 298 | struct vx_core *chip = link->priv; |
303 | 299 | ||
304 | snd_printdd(KERN_DEBUG "RESUME\n"); | 300 | snd_printdd(KERN_DEBUG "RESUME\n"); |
305 | link->state &= ~DEV_SUSPEND; | ||
306 | |||
307 | snd_printdd(KERN_DEBUG "CARD_RESET\n"); | ||
308 | if (DEV_OK(link)) { | 301 | if (DEV_OK(link)) { |
309 | //struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; | 302 | //struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; |
310 | snd_printdd(KERN_DEBUG "requestconfig...\n"); | ||
311 | pcmcia_request_configuration(link->handle, &link->conf); | ||
312 | if (chip) { | 303 | if (chip) { |
313 | snd_printdd(KERN_DEBUG "calling snd_vx_resume\n"); | 304 | snd_printdd(KERN_DEBUG "calling snd_vx_resume\n"); |
314 | snd_vx_resume(chip); | 305 | snd_vx_resume(chip); |