summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRahul Bedarkar <rahulbedarkar89@gmail.com>2017-04-21 13:07:57 +0200
committerSebastian Reichel <sre@kernel.org>2017-05-01 11:52:24 +0200
commit756e142a4b3b25aac44eaa54ded125fce0e8fcc7 (patch)
tree318cc891338a27801ca22abd063c1cc4d0d52367
parentpower: supply: sbs-battery: fix the sbs interrupt request (diff)
downloadlinux-756e142a4b3b25aac44eaa54ded125fce0e8fcc7.tar.xz
linux-756e142a4b3b25aac44eaa54ded125fce0e8fcc7.zip
power: supply: generic-adc-battery: use SIMPLE_DEV_PM_OPS helper macro
Replace ifdefs with SIMPLE_DEV_PM_OPS helper macro. Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
-rw-r--r--drivers/power/supply/generic-adc-battery.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
index edb36bf781b0..37e523374fe0 100644
--- a/drivers/power/supply/generic-adc-battery.c
+++ b/drivers/power/supply/generic-adc-battery.c
@@ -383,8 +383,7 @@ static int gab_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-static int gab_suspend(struct device *dev)
+static int __maybe_unused gab_suspend(struct device *dev)
{
struct gab *adc_bat = dev_get_drvdata(dev);
@@ -393,7 +392,7 @@ static int gab_suspend(struct device *dev)
return 0;
}
-static int gab_resume(struct device *dev)
+static int __maybe_unused gab_resume(struct device *dev)
{
struct gab *adc_bat = dev_get_drvdata(dev);
struct gab_platform_data *pdata = adc_bat->pdata;
@@ -407,20 +406,12 @@ static int gab_resume(struct device *dev)
return 0;
}
-static const struct dev_pm_ops gab_pm_ops = {
- .suspend = gab_suspend,
- .resume = gab_resume,
-};
-
-#define GAB_PM_OPS (&gab_pm_ops)
-#else
-#define GAB_PM_OPS (NULL)
-#endif
+static SIMPLE_DEV_PM_OPS(gab_pm_ops, gab_suspend, gab_resume);
static struct platform_driver gab_driver = {
.driver = {
.name = "generic-adc-battery",
- .pm = GAB_PM_OPS
+ .pm = &gab_pm_ops,
},
.probe = gab_probe,
.remove = gab_remove,