Commit 5214e565 authored by Mark Brown's avatar Mark Brown Committed by Samuel Ortiz

mfd: Convert aat2870 to dev_pm_ops

The I2C suspend and resume functions have been deprecated since the driver
was introduced.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarJin Park <jinyoungp@nvidia.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 953c7d02
...@@ -468,9 +468,10 @@ static int aat2870_i2c_remove(struct i2c_client *client) ...@@ -468,9 +468,10 @@ static int aat2870_i2c_remove(struct i2c_client *client)
return 0; return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state) static int aat2870_i2c_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct aat2870_data *aat2870 = i2c_get_clientdata(client); struct aat2870_data *aat2870 = i2c_get_clientdata(client);
aat2870_disable(aat2870); aat2870_disable(aat2870);
...@@ -478,8 +479,9 @@ static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state) ...@@ -478,8 +479,9 @@ static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state)
return 0; return 0;
} }
static int aat2870_i2c_resume(struct i2c_client *client) static int aat2870_i2c_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct aat2870_data *aat2870 = i2c_get_clientdata(client); struct aat2870_data *aat2870 = i2c_get_clientdata(client);
struct aat2870_register *reg = NULL; struct aat2870_register *reg = NULL;
int i; int i;
...@@ -495,10 +497,10 @@ static int aat2870_i2c_resume(struct i2c_client *client) ...@@ -495,10 +497,10 @@ static int aat2870_i2c_resume(struct i2c_client *client)
return 0; return 0;
} }
#else #endif /* CONFIG_PM_SLEEP */
#define aat2870_i2c_suspend NULL
#define aat2870_i2c_resume NULL static SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend,
#endif /* CONFIG_PM */ aat2870_i2c_resume);
static const struct i2c_device_id aat2870_i2c_id_table[] = { static const struct i2c_device_id aat2870_i2c_id_table[] = {
{ "aat2870", 0 }, { "aat2870", 0 },
...@@ -510,11 +512,10 @@ static struct i2c_driver aat2870_i2c_driver = { ...@@ -510,11 +512,10 @@ static struct i2c_driver aat2870_i2c_driver = {
.driver = { .driver = {
.name = "aat2870", .name = "aat2870",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &aat2870_pm_ops,
}, },
.probe = aat2870_i2c_probe, .probe = aat2870_i2c_probe,
.remove = aat2870_i2c_remove, .remove = aat2870_i2c_remove,
.suspend = aat2870_i2c_suspend,
.resume = aat2870_i2c_resume,
.id_table = aat2870_i2c_id_table, .id_table = aat2870_i2c_id_table,
}; };
......
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