summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-08-21 09:48:33 +0200
committerTakashi Iwai <tiwai@suse.de>2015-08-21 19:27:23 +0200
commit9bc07dfbcde5b6f3aefa06b902b47eef9769d260 (patch)
treee559087d82895098a2c7b78a074857dadc675ddb /drivers/input
parent00833d70ca29a9d60c694b9475a9d3327ed9461e (diff)
downloadlinux-9bc07dfbcde5b6f3aefa06b902b47eef9769d260.tar.bz2
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 'drivers/input')
-rw-r--r--drivers/input/touchscreen/wm97xx-core.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index b1ae77995968..1534e9b0788c 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -732,8 +732,7 @@ static int wm97xx_remove(struct device *dev)
return 0;
}
-#ifdef CONFIG_PM
-static int wm97xx_suspend(struct device *dev, pm_message_t state)
+static int __maybe_unused wm97xx_suspend(struct device *dev)
{
struct wm97xx *wm = dev_get_drvdata(dev);
u16 reg;
@@ -765,7 +764,7 @@ static int wm97xx_suspend(struct device *dev, pm_message_t state)
return 0;
}
-static int wm97xx_resume(struct device *dev)
+static int __maybe_unused wm97xx_resume(struct device *dev)
{
struct wm97xx *wm = dev_get_drvdata(dev);
@@ -799,10 +798,7 @@ static int wm97xx_resume(struct device *dev)
return 0;
}
-#else
-#define wm97xx_suspend NULL
-#define wm97xx_resume NULL
-#endif
+static SIMPLE_DEV_PM_OPS(wm97xx_pm_ops, wm97xx_suspend, wm97xx_resume);
/*
* Machine specific operations
@@ -836,8 +832,7 @@ static struct device_driver wm97xx_driver = {
.owner = THIS_MODULE,
.probe = wm97xx_probe,
.remove = wm97xx_remove,
- .suspend = wm97xx_suspend,
- .resume = wm97xx_resume,
+ .pm = &wm97xx_pm_ops,
};
static int __init wm97xx_init(void)