* [PATCH] power: supply: generic-adc-battery: use SIMPLE_DEV_PM_OPS helper macro
@ 2017-04-21 11:07 Rahul Bedarkar
2017-05-01 11:31 ` Sebastian Reichel
0 siblings, 1 reply; 2+ messages in thread
From: Rahul Bedarkar @ 2017-04-21 11:07 UTC (permalink / raw)
To: Sebastian Reichel; +Cc: linux-pm, linux-kernel, Rahul Bedarkar
Replace ifdefs with SIMPLE_DEV_PM_OPS helper macro.
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com>
---
drivers/power/supply/generic-adc-battery.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
index edb36bf..37e5233 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,
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] power: supply: generic-adc-battery: use SIMPLE_DEV_PM_OPS helper macro
2017-04-21 11:07 [PATCH] power: supply: generic-adc-battery: use SIMPLE_DEV_PM_OPS helper macro Rahul Bedarkar
@ 2017-05-01 11:31 ` Sebastian Reichel
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2017-05-01 11:31 UTC (permalink / raw)
To: Rahul Bedarkar; +Cc: linux-pm, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 227 bytes --]
Hi,
On Fri, Apr 21, 2017 at 04:37:57PM +0530, Rahul Bedarkar wrote:
> Replace ifdefs with SIMPLE_DEV_PM_OPS helper macro.
>
> Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com>
Thanks, queued.
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-01 11:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-21 11:07 [PATCH] power: supply: generic-adc-battery: use SIMPLE_DEV_PM_OPS helper macro Rahul Bedarkar
2017-05-01 11:31 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).