diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-03-10 09:34:07 -0400 |
---|---|---|
committer | Anton Vorontsov <anton@enomsg.org> | 2013-04-01 02:01:17 -0400 |
commit | 9c1d1af0cf78a7e8967194a4ee424b0742a52921 (patch) | |
tree | eba6e16984ffb2addd994a0c90857c62c725704f /drivers/power | |
parent | 43cf454aba2516799d571472fa69425e1e15c4bc (diff) |
sbs-battery: Use dev_pm_ops
Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/sbs-battery.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/power/sbs-battery.c b/drivers/power/sbs-battery.c index 3922f06120c8..c8c78a74e75a 100644 --- a/drivers/power/sbs-battery.c +++ b/drivers/power/sbs-battery.c | |||
@@ -820,10 +820,11 @@ static int sbs_remove(struct i2c_client *client) | |||
820 | return 0; | 820 | return 0; |
821 | } | 821 | } |
822 | 822 | ||
823 | #if defined CONFIG_PM | 823 | #if defined CONFIG_PM_SLEEP |
824 | static int sbs_suspend(struct i2c_client *client, | 824 | |
825 | pm_message_t state) | 825 | static int sbs_suspend(struct device *dev) |
826 | { | 826 | { |
827 | struct i2c_client *client = to_i2c_client(dev); | ||
827 | struct sbs_info *chip = i2c_get_clientdata(client); | 828 | struct sbs_info *chip = i2c_get_clientdata(client); |
828 | s32 ret; | 829 | s32 ret; |
829 | 830 | ||
@@ -838,11 +839,13 @@ static int sbs_suspend(struct i2c_client *client, | |||
838 | 839 | ||
839 | return 0; | 840 | return 0; |
840 | } | 841 | } |
842 | |||
843 | static SIMPLE_DEV_PM_OPS(sbs_pm_ops, sbs_suspend, NULL); | ||
844 | #define SBS_PM_OPS (&sbs_pm_ops) | ||
845 | |||
841 | #else | 846 | #else |
842 | #define sbs_suspend NULL | 847 | #define SBS_PM_OPS NULL |
843 | #endif | 848 | #endif |
844 | /* any smbus transaction will wake up sbs */ | ||
845 | #define sbs_resume NULL | ||
846 | 849 | ||
847 | static const struct i2c_device_id sbs_id[] = { | 850 | static const struct i2c_device_id sbs_id[] = { |
848 | { "bq20z75", 0 }, | 851 | { "bq20z75", 0 }, |
@@ -854,12 +857,11 @@ MODULE_DEVICE_TABLE(i2c, sbs_id); | |||
854 | static struct i2c_driver sbs_battery_driver = { | 857 | static struct i2c_driver sbs_battery_driver = { |
855 | .probe = sbs_probe, | 858 | .probe = sbs_probe, |
856 | .remove = sbs_remove, | 859 | .remove = sbs_remove, |
857 | .suspend = sbs_suspend, | ||
858 | .resume = sbs_resume, | ||
859 | .id_table = sbs_id, | 860 | .id_table = sbs_id, |
860 | .driver = { | 861 | .driver = { |
861 | .name = "sbs-battery", | 862 | .name = "sbs-battery", |
862 | .of_match_table = of_match_ptr(sbs_dt_ids), | 863 | .of_match_table = of_match_ptr(sbs_dt_ids), |
864 | .pm = SBS_PM_OPS, | ||
863 | }, | 865 | }, |
864 | }; | 866 | }; |
865 | module_i2c_driver(sbs_battery_driver); | 867 | module_i2c_driver(sbs_battery_driver); |