aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-28 12:40:28 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2012-01-08 18:37:48 -0500
commit5214e5659a9760cd01aa14171c8fdf38d3deec3a (patch)
treeb12c47396c6393f6844d588559b63838ab60723e /drivers
parent953c7d025d97916e56fd6f1bd347e1c19fd7d5f5 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/aat2870-core.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index e6da563178df..3aa36eb5c79b 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -468,9 +468,10 @@ static int aat2870_i2c_remove(struct i2c_client *client)
468 return 0; 468 return 0;
469} 469}
470 470
471#ifdef CONFIG_PM 471#ifdef CONFIG_PM_SLEEP
472static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state) 472static int aat2870_i2c_suspend(struct device *dev)
473{ 473{
474 struct i2c_client *client = to_i2c_client(dev);
474 struct aat2870_data *aat2870 = i2c_get_clientdata(client); 475 struct aat2870_data *aat2870 = i2c_get_clientdata(client);
475 476
476 aat2870_disable(aat2870); 477 aat2870_disable(aat2870);
@@ -478,8 +479,9 @@ static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state)
478 return 0; 479 return 0;
479} 480}
480 481
481static int aat2870_i2c_resume(struct i2c_client *client) 482static int aat2870_i2c_resume(struct device *dev)
482{ 483{
484 struct i2c_client *client = to_i2c_client(dev);
483 struct aat2870_data *aat2870 = i2c_get_clientdata(client); 485 struct aat2870_data *aat2870 = i2c_get_clientdata(client);
484 struct aat2870_register *reg = NULL; 486 struct aat2870_register *reg = NULL;
485 int i; 487 int i;
@@ -495,10 +497,10 @@ static int aat2870_i2c_resume(struct i2c_client *client)
495 497
496 return 0; 498 return 0;
497} 499}
498#else 500#endif /* CONFIG_PM_SLEEP */
499#define aat2870_i2c_suspend NULL 501
500#define aat2870_i2c_resume NULL 502static SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend,
501#endif /* CONFIG_PM */ 503 aat2870_i2c_resume);
502 504
503static const struct i2c_device_id aat2870_i2c_id_table[] = { 505static const struct i2c_device_id aat2870_i2c_id_table[] = {
504 { "aat2870", 0 }, 506 { "aat2870", 0 },
@@ -510,11 +512,10 @@ static struct i2c_driver aat2870_i2c_driver = {
510 .driver = { 512 .driver = {
511 .name = "aat2870", 513 .name = "aat2870",
512 .owner = THIS_MODULE, 514 .owner = THIS_MODULE,
515 .pm = &aat2870_pm_ops,
513 }, 516 },
514 .probe = aat2870_i2c_probe, 517 .probe = aat2870_i2c_probe,
515 .remove = aat2870_i2c_remove, 518 .remove = aat2870_i2c_remove,
516 .suspend = aat2870_i2c_suspend,
517 .resume = aat2870_i2c_resume,
518 .id_table = aat2870_i2c_id_table, 519 .id_table = aat2870_i2c_id_table,
519}; 520};
520 521