diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-08-21 09:48:33 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-08-21 19:27:23 +0200 |
commit | 9bc07dfbcde5b6f3aefa06b902b47eef9769d260 (patch) | |
tree | e559087d82895098a2c7b78a074857dadc675ddb /sound/ac97_bus.c | |
parent | 00833d70ca29a9d60c694b9475a9d3327ed9461e (diff) |
ALSA: ac97: Switch to dev_pm_ops
Convert the ac97_bus from legacy suspend/resume callbacks to dev_pm_ops.
Since there isn't anything special to do at the bus level the bus driver
does not have to implement any callbacks. The device driver core will
automatically pick up and execute the device's PM ops.
As there is only a single AC'97 driver implementing suspend and resume,
update both the core and driver at the same time to avoid unnecessary code
churn.
While we are at it also drop the ifdefs around the suspend/resume functions
to increase compile test coverage.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/ac97_bus.c')
-rw-r--r-- | sound/ac97_bus.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/sound/ac97_bus.c b/sound/ac97_bus.c index 2b50cbe6aca9..57a6dfc4b694 100644 --- a/sound/ac97_bus.c +++ b/sound/ac97_bus.c @@ -27,35 +27,9 @@ static int ac97_bus_match(struct device *dev, struct device_driver *drv) return 1; } -#ifdef CONFIG_PM -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); - - return ret; -} - -static int ac97_bus_resume(struct device *dev) -{ - int ret = 0; - - if (dev->driver && dev->driver->resume) - ret = dev->driver->resume(dev); - - return ret; -} -#endif /* CONFIG_PM */ - struct bus_type ac97_bus_type = { .name = "ac97", .match = ac97_bus_match, -#ifdef CONFIG_PM - .suspend = ac97_bus_suspend, - .resume = ac97_bus_resume, -#endif /* CONFIG_PM */ }; static int __init ac97_bus_init(void) |