summaryrefslogtreecommitdiffstats
path: root/drivers/power/ds2782_battery.c
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2014-10-10 00:50:26 +0200
committerSebastian Reichel <sre@kernel.org>2014-11-17 03:07:11 +0100
commit99a79565e6db676bca8c7aeddd9fec44e730965e (patch)
tree20a76e26384931cefc3d40390251190219622bc7 /drivers/power/ds2782_battery.c
parentpower/reset: brcmstb: Register with kernel restart handler (diff)
downloadlinux-99a79565e6db676bca8c7aeddd9fec44e730965e.tar.xz
linux-99a79565e6db676bca8c7aeddd9fec44e730965e.zip
power: ds2782_battery: Simplify the PM hooks
The SIMPLE_DEV_PM_OPS() macro already takes care of the CONFIG_PM_SLEEP=n case, so we can simplify the code a little bit. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power/ds2782_battery.c')
-rw-r--r--drivers/power/ds2782_battery.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c
index 041f9b638d28..39694883d3bf 100644
--- a/drivers/power/ds2782_battery.c
+++ b/drivers/power/ds2782_battery.c
@@ -351,13 +351,9 @@ static int ds278x_resume(struct device *dev)
schedule_delayed_work(&info->bat_work, DS278x_DELAY);
return 0;
}
+#endif /* CONFIG_PM_SLEEP */
static SIMPLE_DEV_PM_OPS(ds278x_battery_pm_ops, ds278x_suspend, ds278x_resume);
-#define DS278X_BATTERY_PM_OPS (&ds278x_battery_pm_ops)
-
-#else
-#define DS278X_BATTERY_PM_OPS NULL
-#endif /* CONFIG_PM_SLEEP */
enum ds278x_num_id {
DS2782 = 0,
@@ -460,7 +456,7 @@ MODULE_DEVICE_TABLE(i2c, ds278x_id);
static struct i2c_driver ds278x_battery_driver = {
.driver = {
.name = "ds2782-battery",
- .pm = DS278X_BATTERY_PM_OPS,
+ .pm = &ds278x_battery_pm_ops,
},
.probe = ds278x_battery_probe,
.remove = ds278x_battery_remove,