Skip to content

Commit

Permalink
[ALSA] clean suspend/resume calls for ac97_bus_type
Browse files Browse the repository at this point in the history
AC97 Codec
A single call to the driver suspend/resume method for each device is
enough. The level and SUSPEND_*/RESUME_* arguments are deprecated and
said to be removed eventually anyway (no other subsystem are using them
anymore except platform devices).

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Nicolas Pitre authored and Jaroslav Kysela committed Oct 7, 2005
1 parent 72e75de commit 90b66e8
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions sound/pci/ac97/ac97_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,17 @@ static int ac97_bus_suspend(struct device *dev, pm_message_t state)
{
int ret = 0;

if (dev->driver && dev->driver->suspend) {
ret = dev->driver->suspend(dev, state, SUSPEND_DISABLE);
if (ret == 0)
ret = dev->driver->suspend(dev, state, SUSPEND_SAVE_STATE);
if (ret == 0)
ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN);
}
if (dev->driver && dev->driver->suspend)
ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN);
return ret;
}

static int ac97_bus_resume(struct device *dev)
{
int ret = 0;

if (dev->driver && dev->driver->resume) {
if (dev->driver && dev->driver->resume)
ret = dev->driver->resume(dev, RESUME_POWER_ON);
if (ret == 0)
ret = dev->driver->resume(dev, RESUME_RESTORE_STATE);
if (ret == 0)
ret = dev->driver->resume(dev, RESUME_ENABLE);
}
return ret;
}

Expand Down

0 comments on commit 90b66e8

Please sign in to comment.