Commit 65b0c038 authored by Mark Brown's avatar Mark Brown Committed by Dmitry Torokhov

Input: lm8323 - convert to dev_pm_ops

There is a general move away from bus specific PM operations to using
dev_pm_ops in order to facilicate core improvements. Update lm8323 to
the new model.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent a257090c
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/pm.h>
#include <linux/i2c/lm8323.h> #include <linux/i2c/lm8323.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -802,8 +803,9 @@ static int __devexit lm8323_remove(struct i2c_client *client) ...@@ -802,8 +803,9 @@ static int __devexit lm8323_remove(struct i2c_client *client)
* We don't need to explicitly suspend the chip, as it already switches off * We don't need to explicitly suspend the chip, as it already switches off
* when there's no activity. * when there's no activity.
*/ */
static int lm8323_suspend(struct i2c_client *client, pm_message_t mesg) static int lm8323_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct lm8323_chip *lm = i2c_get_clientdata(client); struct lm8323_chip *lm = i2c_get_clientdata(client);
int i; int i;
...@@ -821,8 +823,9 @@ static int lm8323_suspend(struct i2c_client *client, pm_message_t mesg) ...@@ -821,8 +823,9 @@ static int lm8323_suspend(struct i2c_client *client, pm_message_t mesg)
return 0; return 0;
} }
static int lm8323_resume(struct i2c_client *client) static int lm8323_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct lm8323_chip *lm = i2c_get_clientdata(client); struct lm8323_chip *lm = i2c_get_clientdata(client);
int i; int i;
...@@ -839,11 +842,10 @@ static int lm8323_resume(struct i2c_client *client) ...@@ -839,11 +842,10 @@ static int lm8323_resume(struct i2c_client *client)
return 0; return 0;
} }
#else
#define lm8323_suspend NULL
#define lm8323_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(lm8323_pm_ops, lm8323_suspend, lm8323_resume);
static const struct i2c_device_id lm8323_id[] = { static const struct i2c_device_id lm8323_id[] = {
{ "lm8323", 0 }, { "lm8323", 0 },
{ } { }
...@@ -852,11 +854,10 @@ static const struct i2c_device_id lm8323_id[] = { ...@@ -852,11 +854,10 @@ static const struct i2c_device_id lm8323_id[] = {
static struct i2c_driver lm8323_i2c_driver = { static struct i2c_driver lm8323_i2c_driver = {
.driver = { .driver = {
.name = "lm8323", .name = "lm8323",
.pm = &lm8323_pm_ops,
}, },
.probe = lm8323_probe, .probe = lm8323_probe,
.remove = __devexit_p(lm8323_remove), .remove = __devexit_p(lm8323_remove),
.suspend = lm8323_suspend,
.resume = lm8323_resume,
.id_table = lm8323_id, .id_table = lm8323_id,
}; };
MODULE_DEVICE_TABLE(i2c, lm8323_id); MODULE_DEVICE_TABLE(i2c, lm8323_id);
......
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