Commit 756e142a authored by Rahul Bedarkar's avatar Rahul Bedarkar Committed by Sebastian Reichel

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

Replace ifdefs with SIMPLE_DEV_PM_OPS helper macro.
Signed-off-by: default avatarRahul Bedarkar <rahulbedarkar89@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
parent bb8fe8ea
...@@ -383,8 +383,7 @@ static int gab_remove(struct platform_device *pdev) ...@@ -383,8 +383,7 @@ static int gab_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM static int __maybe_unused gab_suspend(struct device *dev)
static int gab_suspend(struct device *dev)
{ {
struct gab *adc_bat = dev_get_drvdata(dev); struct gab *adc_bat = dev_get_drvdata(dev);
...@@ -393,7 +392,7 @@ static int gab_suspend(struct device *dev) ...@@ -393,7 +392,7 @@ static int gab_suspend(struct device *dev)
return 0; 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 *adc_bat = dev_get_drvdata(dev);
struct gab_platform_data *pdata = adc_bat->pdata; struct gab_platform_data *pdata = adc_bat->pdata;
...@@ -407,20 +406,12 @@ static int gab_resume(struct device *dev) ...@@ -407,20 +406,12 @@ static int gab_resume(struct device *dev)
return 0; return 0;
} }
static const struct dev_pm_ops gab_pm_ops = { static SIMPLE_DEV_PM_OPS(gab_pm_ops, gab_suspend, gab_resume);
.suspend = gab_suspend,
.resume = gab_resume,
};
#define GAB_PM_OPS (&gab_pm_ops)
#else
#define GAB_PM_OPS (NULL)
#endif
static struct platform_driver gab_driver = { static struct platform_driver gab_driver = {
.driver = { .driver = {
.name = "generic-adc-battery", .name = "generic-adc-battery",
.pm = GAB_PM_OPS .pm = &gab_pm_ops,
}, },
.probe = gab_probe, .probe = gab_probe,
.remove = gab_remove, .remove = gab_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment