aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2014-10-09 18:50:26 -0400
committerSebastian Reichel <sre@kernel.org>2014-11-16 21:07:11 -0500
commit99a79565e6db676bca8c7aeddd9fec44e730965e (patch)
tree20a76e26384931cefc3d40390251190219622bc7
parent6136c41ae9c7af4bd89d845bda5dd84b9c9f3138 (diff)
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>
-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)
351 schedule_delayed_work(&info->bat_work, DS278x_DELAY); 351 schedule_delayed_work(&info->bat_work, DS278x_DELAY);
352 return 0; 352 return 0;
353} 353}
354#endif /* CONFIG_PM_SLEEP */
354 355
355static SIMPLE_DEV_PM_OPS(ds278x_battery_pm_ops, ds278x_suspend, ds278x_resume); 356static SIMPLE_DEV_PM_OPS(ds278x_battery_pm_ops, ds278x_suspend, ds278x_resume);
356#define DS278X_BATTERY_PM_OPS (&ds278x_battery_pm_ops)
357
358#else
359#define DS278X_BATTERY_PM_OPS NULL
360#endif /* CONFIG_PM_SLEEP */
361 357
362enum ds278x_num_id { 358enum ds278x_num_id {
363 DS2782 = 0, 359 DS2782 = 0,
@@ -460,7 +456,7 @@ MODULE_DEVICE_TABLE(i2c, ds278x_id);
460static struct i2c_driver ds278x_battery_driver = { 456static struct i2c_driver ds278x_battery_driver = {
461 .driver = { 457 .driver = {
462 .name = "ds2782-battery", 458 .name = "ds2782-battery",
463 .pm = DS278X_BATTERY_PM_OPS, 459 .pm = &ds278x_battery_pm_ops,
464 }, 460 },
465 .probe = ds278x_battery_probe, 461 .probe = ds278x_battery_probe,
466 .remove = ds278x_battery_remove, 462 .remove = ds278x_battery_remove,