Commit 48e41c70 authored by Anton Vorontsov's avatar Anton Vorontsov

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: default avatarAnton Vorontsov <anton.vorontsov@linaro.org>
parent 48bc1774
...@@ -727,7 +727,8 @@ static int max17042_suspend(struct device *dev) ...@@ -727,7 +727,8 @@ static int max17042_suspend(struct device *dev)
{ {
struct max17042_chip *chip = dev_get_drvdata(dev); struct max17042_chip *chip = dev_get_drvdata(dev);
/* disable the irq and enable irq_wake /*
* disable the irq and enable irq_wake
* capability to the interrupt line. * capability to the interrupt line.
*/ */
if (chip->client->irq) { if (chip->client->irq) {
...@@ -751,9 +752,15 @@ static int max17042_resume(struct device *dev) ...@@ -751,9 +752,15 @@ static int max17042_resume(struct device *dev)
return 0; return 0;
} }
static const struct dev_pm_ops max17042_pm_ops = {
.suspend = max17042_suspend,
.resume = max17042_resume,
};
#define MAX17042_PM_OPS (&max17042_pm_ops)
#else #else
#define max17042_suspend NULL #define MAX17042_PM_OPS NULL
#define max17042_resume NULL
#endif #endif
#ifdef CONFIG_OF #ifdef CONFIG_OF
...@@ -770,16 +777,11 @@ static const struct i2c_device_id max17042_id[] = { ...@@ -770,16 +777,11 @@ static const struct i2c_device_id max17042_id[] = {
}; };
MODULE_DEVICE_TABLE(i2c, max17042_id); MODULE_DEVICE_TABLE(i2c, max17042_id);
static const struct dev_pm_ops max17042_pm_ops = {
.suspend = max17042_suspend,
.resume = max17042_resume,
};
static struct i2c_driver max17042_i2c_driver = { static struct i2c_driver max17042_i2c_driver = {
.driver = { .driver = {
.name = "max17042", .name = "max17042",
.of_match_table = of_match_ptr(max17042_dt_match), .of_match_table = of_match_ptr(max17042_dt_match),
.pm = &max17042_pm_ops, .pm = MAX17042_PM_OPS,
}, },
.probe = max17042_probe, .probe = max17042_probe,
.remove = __devexit_p(max17042_remove), .remove = __devexit_p(max17042_remove),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment