Skip to contentSkip to conversation

power: supply: generic-adc-battery: use SIMPLE_DEV_PM_OPS helper macro

PATCH In review Rahul Bedarkar 2 participants 2 messages Apr 21, 2017 – May 1, 2017 Power supply

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: generic-adc-battery: use SIMPLE_DEV_PM_OPS helper macro

Replace ifdefs with SIMPLE_DEV_PM_OPS helper macro.

---
 drivers/power/supply/generic-adc-battery.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)
drivers/power/supply/generic-adc-battery.c +4 -13
index edb36bf..37e5233 100644
@@ -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,
Signature · 1 line
2.7.4