aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorManish Badarkhe <badarkhe.manish@gmail.com>2013-10-14 01:26:51 -0400
committerAnton Vorontsov <anton@enomsg.org>2013-10-25 19:48:30 -0400
commit3d23c7f457ed86f27425cb3f229b76720855a26d (patch)
tree4d302f3f57a8f0fc3fbd842c3d26fc45b55d509e /drivers/power
parent883c10a9dd8099e7519cdc43b75ac4066a6ae98d (diff)
max17042_battery: Use SIMPLE_DEV_PM_OPS
Use the SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. Signed-off-by: Manish Badarkhe <badarkhe.manish@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/max17042_battery.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
index d664ef58afa7..bd72b0f7f729 100644
--- a/drivers/power/max17042_battery.c
+++ b/drivers/power/max17042_battery.c
@@ -786,7 +786,7 @@ static int max17042_remove(struct i2c_client *client)
786 return 0; 786 return 0;
787} 787}
788 788
789#ifdef CONFIG_PM 789#ifdef CONFIG_PM_SLEEP
790static int max17042_suspend(struct device *dev) 790static int max17042_suspend(struct device *dev)
791{ 791{
792 struct max17042_chip *chip = dev_get_drvdata(dev); 792 struct max17042_chip *chip = dev_get_drvdata(dev);
@@ -816,17 +816,11 @@ static int max17042_resume(struct device *dev)
816 816
817 return 0; 817 return 0;
818} 818}
819
820static const struct dev_pm_ops max17042_pm_ops = {
821 .suspend = max17042_suspend,
822 .resume = max17042_resume,
823};
824
825#define MAX17042_PM_OPS (&max17042_pm_ops)
826#else
827#define MAX17042_PM_OPS NULL
828#endif 819#endif
829 820
821static SIMPLE_DEV_PM_OPS(max17042_pm_ops, max17042_suspend,
822 max17042_resume);
823
830#ifdef CONFIG_OF 824#ifdef CONFIG_OF
831static const struct of_device_id max17042_dt_match[] = { 825static const struct of_device_id max17042_dt_match[] = {
832 { .compatible = "maxim,max17042" }, 826 { .compatible = "maxim,max17042" },
@@ -849,7 +843,7 @@ static struct i2c_driver max17042_i2c_driver = {
849 .driver = { 843 .driver = {
850 .name = "max17042", 844 .name = "max17042",
851 .of_match_table = of_match_ptr(max17042_dt_match), 845 .of_match_table = of_match_ptr(max17042_dt_match),
852 .pm = MAX17042_PM_OPS, 846 .pm = &max17042_pm_ops,
853 }, 847 },
854 .probe = max17042_probe, 848 .probe = max17042_probe,
855 .remove = max17042_remove, 849 .remove = max17042_remove,