mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
Input: eeti_ts - convert to dev_pm_ops
There is a general move towards the use of dev_pm_ops rather than bus specific suspend APIs as this simplifies both the bus and PM core implementations. Convert the eeti_ts driver over. Compile tested only by me, but Sven Neumann reports that the new code works. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Sven Neumann <s.neumann@raumfeld.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
d5dc9ac3f6
commit
85012fff38
@ -261,8 +261,9 @@ static int __devexit eeti_ts_remove(struct i2c_client *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg)
|
static int eeti_ts_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
|
struct i2c_client *client = to_i2c_client(dev);
|
||||||
struct eeti_ts_priv *priv = i2c_get_clientdata(client);
|
struct eeti_ts_priv *priv = i2c_get_clientdata(client);
|
||||||
struct input_dev *input_dev = priv->input;
|
struct input_dev *input_dev = priv->input;
|
||||||
|
|
||||||
@ -279,8 +280,9 @@ static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int eeti_ts_resume(struct i2c_client *client)
|
static int eeti_ts_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
|
struct i2c_client *client = to_i2c_client(dev);
|
||||||
struct eeti_ts_priv *priv = i2c_get_clientdata(client);
|
struct eeti_ts_priv *priv = i2c_get_clientdata(client);
|
||||||
struct input_dev *input_dev = priv->input;
|
struct input_dev *input_dev = priv->input;
|
||||||
|
|
||||||
@ -296,9 +298,8 @@ static int eeti_ts_resume(struct i2c_client *client)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define eeti_ts_suspend NULL
|
static SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume);
|
||||||
#define eeti_ts_resume NULL
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct i2c_device_id eeti_ts_id[] = {
|
static const struct i2c_device_id eeti_ts_id[] = {
|
||||||
@ -310,11 +311,12 @@ MODULE_DEVICE_TABLE(i2c, eeti_ts_id);
|
|||||||
static struct i2c_driver eeti_ts_driver = {
|
static struct i2c_driver eeti_ts_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "eeti_ts",
|
.name = "eeti_ts",
|
||||||
|
#ifdef CONFIG_PM
|
||||||
|
.pm = &eeti_ts_pm,
|
||||||
|
#endif
|
||||||
},
|
},
|
||||||
.probe = eeti_ts_probe,
|
.probe = eeti_ts_probe,
|
||||||
.remove = __devexit_p(eeti_ts_remove),
|
.remove = __devexit_p(eeti_ts_remove),
|
||||||
.suspend = eeti_ts_suspend,
|
|
||||||
.resume = eeti_ts_resume,
|
|
||||||
.id_table = eeti_ts_id,
|
.id_table = eeti_ts_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user