diff options
| -rw-r--r-- | drivers/power/max17042_battery.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c index 07dee974a70e..738648d1d9fc 100644 --- a/drivers/power/max17042_battery.c +++ b/drivers/power/max17042_battery.c | |||
| @@ -727,7 +727,8 @@ static int max17042_suspend(struct device *dev) | |||
| 727 | { | 727 | { |
| 728 | struct max17042_chip *chip = dev_get_drvdata(dev); | 728 | struct max17042_chip *chip = dev_get_drvdata(dev); |
| 729 | 729 | ||
| 730 | /* disable the irq and enable irq_wake | 730 | /* |
| 731 | * disable the irq and enable irq_wake | ||
| 731 | * capability to the interrupt line. | 732 | * capability to the interrupt line. |
| 732 | */ | 733 | */ |
| 733 | if (chip->client->irq) { | 734 | if (chip->client->irq) { |
| @@ -751,9 +752,15 @@ static int max17042_resume(struct device *dev) | |||
| 751 | 752 | ||
| 752 | return 0; | 753 | return 0; |
| 753 | } | 754 | } |
| 755 | |||
| 756 | static const struct dev_pm_ops max17042_pm_ops = { | ||
| 757 | .suspend = max17042_suspend, | ||
| 758 | .resume = max17042_resume, | ||
| 759 | }; | ||
| 760 | |||
| 761 | #define MAX17042_PM_OPS (&max17042_pm_ops) | ||
| 754 | #else | 762 | #else |
| 755 | #define max17042_suspend NULL | 763 | #define MAX17042_PM_OPS NULL |
| 756 | #define max17042_resume NULL | ||
| 757 | #endif | 764 | #endif |
| 758 | 765 | ||
| 759 | #ifdef CONFIG_OF | 766 | #ifdef CONFIG_OF |
| @@ -770,16 +777,11 @@ static const struct i2c_device_id max17042_id[] = { | |||
| 770 | }; | 777 | }; |
| 771 | MODULE_DEVICE_TABLE(i2c, max17042_id); | 778 | MODULE_DEVICE_TABLE(i2c, max17042_id); |
| 772 | 779 | ||
| 773 | static const struct dev_pm_ops max17042_pm_ops = { | ||
| 774 | .suspend = max17042_suspend, | ||
| 775 | .resume = max17042_resume, | ||
| 776 | }; | ||
| 777 | |||
| 778 | static struct i2c_driver max17042_i2c_driver = { | 780 | static struct i2c_driver max17042_i2c_driver = { |
| 779 | .driver = { | 781 | .driver = { |
| 780 | .name = "max17042", | 782 | .name = "max17042", |
| 781 | .of_match_table = of_match_ptr(max17042_dt_match), | 783 | .of_match_table = of_match_ptr(max17042_dt_match), |
| 782 | .pm = &max17042_pm_ops, | 784 | .pm = MAX17042_PM_OPS, |
| 783 | }, | 785 | }, |
| 784 | .probe = max17042_probe, | 786 | .probe = max17042_probe, |
| 785 | .remove = __devexit_p(max17042_remove), | 787 | .remove = __devexit_p(max17042_remove), |
