Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90b66e83 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Jaroslav Kysela
Browse files

[ALSA] clean suspend/resume calls for ac97_bus_type



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: default avatarNicolas Pitre <nico@cam.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 72e75de2
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -30,13 +30,8 @@ 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)
	if (dev->driver && dev->driver->suspend)
		ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN);
	}
	return ret;
}

@@ -44,13 +39,8 @@ 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;
}