提交 6b7cfd19 编写于 作者: M Mark Brown 提交者: Dmitry Torokhov

Input: ad714x-i2c - convert to dev_pm_ops

There is a general move to convert drivers to use dev_pm_ops rather than
bus specific PM operations in order to facilitate core work. Do this
conversion for ad714x-i2c.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: NMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 4dfcc271
...@@ -10,23 +10,23 @@ ...@@ -10,23 +10,23 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/pm.h>
#include "ad714x.h" #include "ad714x.h"
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int ad714x_i2c_suspend(struct i2c_client *client, pm_message_t message) static int ad714x_i2c_suspend(struct device *dev)
{ {
return ad714x_disable(i2c_get_clientdata(client)); return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev)));
} }
static int ad714x_i2c_resume(struct i2c_client *client) static int ad714x_i2c_resume(struct device *dev)
{ {
return ad714x_enable(i2c_get_clientdata(client)); return ad714x_enable(i2c_get_clientdata(to_i2c_client(dev)));
} }
#else
# define ad714x_i2c_suspend NULL
# define ad714x_i2c_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume);
static int ad714x_i2c_write(struct device *dev, unsigned short reg, static int ad714x_i2c_write(struct device *dev, unsigned short reg,
unsigned short data) unsigned short data)
{ {
...@@ -114,11 +114,10 @@ MODULE_DEVICE_TABLE(i2c, ad714x_id); ...@@ -114,11 +114,10 @@ MODULE_DEVICE_TABLE(i2c, ad714x_id);
static struct i2c_driver ad714x_i2c_driver = { static struct i2c_driver ad714x_i2c_driver = {
.driver = { .driver = {
.name = "ad714x_captouch", .name = "ad714x_captouch",
.pm = &ad714x_i2c_pm,
}, },
.probe = ad714x_i2c_probe, .probe = ad714x_i2c_probe,
.remove = __devexit_p(ad714x_i2c_remove), .remove = __devexit_p(ad714x_i2c_remove),
.suspend = ad714x_i2c_suspend,
.resume = ad714x_i2c_resume,
.id_table = ad714x_id, .id_table = ad714x_id,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册