Skip to content

Commit 5214e56

Browse files
broonieSamuel Ortiz
authored andcommitted
mfd: Convert aat2870 to dev_pm_ops
The I2C suspend and resume functions have been deprecated since the driver was introduced. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jin Park <jinyoungp@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent 953c7d0 commit 5214e56

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

‎drivers/mfd/aat2870-core.c‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -468,18 +468,20 @@ static int aat2870_i2c_remove(struct i2c_client *client)
468468
return 0;
469469
}
470470

471-
#ifdef CONFIG_PM
472-
static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state)
471+
#ifdef CONFIG_PM_SLEEP
472+
static int aat2870_i2c_suspend(struct device *dev)
473473
{
474+
struct i2c_client *client = to_i2c_client(dev);
474475
struct aat2870_data *aat2870 = i2c_get_clientdata(client);
475476

476477
aat2870_disable(aat2870);
477478

478479
return 0;
479480
}
480481

481-
static int aat2870_i2c_resume(struct i2c_client *client)
482+
static int aat2870_i2c_resume(struct device *dev)
482483
{
484+
struct i2c_client *client = to_i2c_client(dev);
483485
struct aat2870_data *aat2870 = i2c_get_clientdata(client);
484486
struct aat2870_register *reg = NULL;
485487
int i;
@@ -495,10 +497,10 @@ static int aat2870_i2c_resume(struct i2c_client *client)
495497

496498
return 0;
497499
}
498-
#else
499-
#define aat2870_i2c_suspend NULL
500-
#define aat2870_i2c_resume NULL
501-
#endif /* CONFIG_PM */
500+
#endif /* CONFIG_PM_SLEEP */
501+
502+
static SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend,
503+
aat2870_i2c_resume);
502504

503505
static const struct i2c_device_id aat2870_i2c_id_table[] = {
504506
{ "aat2870", 0 },
@@ -510,11 +512,10 @@ static struct i2c_driver aat2870_i2c_driver = {
510512
.driver = {
511513
.name = "aat2870",
512514
.owner = THIS_MODULE,
515+
.pm = &aat2870_pm_ops,
513516
},
514517
.probe = aat2870_i2c_probe,
515518
.remove = aat2870_i2c_remove,
516-
.suspend = aat2870_i2c_suspend,
517-
.resume = aat2870_i2c_resume,
518519
.id_table = aat2870_i2c_id_table,
519520
};
520521

0 commit comments

Comments
 (0)