Browse Source

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>
Fabio Estevam 10 years ago
parent
commit
99a79565e6
1 changed files with 2 additions and 6 deletions
  1. 2 6
      drivers/power/ds2782_battery.c

+ 2 - 6
drivers/power/ds2782_battery.c

@@ -351,13 +351,9 @@ static int ds278x_resume(struct device *dev)
 	schedule_delayed_work(&info->bat_work, DS278x_DELAY);
 	schedule_delayed_work(&info->bat_work, DS278x_DELAY);
 	return 0;
 	return 0;
 }
 }
+#endif /* CONFIG_PM_SLEEP */
 
 
 static SIMPLE_DEV_PM_OPS(ds278x_battery_pm_ops, ds278x_suspend, ds278x_resume);
 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 {
 enum ds278x_num_id {
 	DS2782 = 0,
 	DS2782 = 0,
@@ -460,7 +456,7 @@ MODULE_DEVICE_TABLE(i2c, ds278x_id);
 static struct i2c_driver ds278x_battery_driver = {
 static struct i2c_driver ds278x_battery_driver = {
 	.driver 	= {
 	.driver 	= {
 		.name	= "ds2782-battery",
 		.name	= "ds2782-battery",
-		.pm	= DS278X_BATTERY_PM_OPS,
+		.pm	= &ds278x_battery_pm_ops,
 	},
 	},
 	.probe		= ds278x_battery_probe,
 	.probe		= ds278x_battery_probe,
 	.remove		= ds278x_battery_remove,
 	.remove		= ds278x_battery_remove,