aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorAnton Vorontsov <anton.vorontsov@linaro.org>2012-05-04 23:38:13 -0400
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-05-04 23:40:27 -0400
commit48e41c70c10f10541d922fc67e7952f06ad59d9a (patch)
tree903ac1100808788cd33850b258197c53d851407d /drivers/power
parent48bc177441d68c0ba70631beb544c3d695328d56 (diff)
max17042_battery: Move dev_pm_ops struct under CONFIG_PM
This is what we do for the rest of the drivers, saves some bytes. Plus a small style change while at it. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/max17042_battery.c20
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
756static 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};
771MODULE_DEVICE_TABLE(i2c, max17042_id); 778MODULE_DEVICE_TABLE(i2c, max17042_id);
772 779
773static const struct dev_pm_ops max17042_pm_ops = {
774 .suspend = max17042_suspend,
775 .resume = max17042_resume,
776};
777
778static struct i2c_driver max17042_i2c_driver = { 780static 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),