Commit 5214e5659a9760cd01aa14171c8fdf38d3deec3a
Committed by
Samuel Ortiz
1 parent
953c7d025d
Exists in
master
and in
6 other branches
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>
Showing 1 changed file with 10 additions and 9 deletions Side-by-side Diff
drivers/mfd/aat2870-core.c
... | ... | @@ -468,9 +468,10 @@ |
468 | 468 | return 0; |
469 | 469 | } |
470 | 470 | |
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) | |
473 | 473 | { |
474 | + struct i2c_client *client = to_i2c_client(dev); | |
474 | 475 | struct aat2870_data *aat2870 = i2c_get_clientdata(client); |
475 | 476 | |
476 | 477 | aat2870_disable(aat2870); |
477 | 478 | |
... | ... | @@ -478,8 +479,9 @@ |
478 | 479 | return 0; |
479 | 480 | } |
480 | 481 | |
481 | -static int aat2870_i2c_resume(struct i2c_client *client) | |
482 | +static int aat2870_i2c_resume(struct device *dev) | |
482 | 483 | { |
484 | + struct i2c_client *client = to_i2c_client(dev); | |
483 | 485 | struct aat2870_data *aat2870 = i2c_get_clientdata(client); |
484 | 486 | struct aat2870_register *reg = NULL; |
485 | 487 | int i; |
486 | 488 | |
... | ... | @@ -495,11 +497,11 @@ |
495 | 497 | |
496 | 498 | return 0; |
497 | 499 | } |
498 | -#else | |
499 | -#define aat2870_i2c_suspend NULL | |
500 | -#define aat2870_i2c_resume NULL | |
501 | -#endif /* CONFIG_PM */ | |
500 | +#endif /* CONFIG_PM_SLEEP */ | |
502 | 501 | |
502 | +static SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend, | |
503 | + aat2870_i2c_resume); | |
504 | + | |
503 | 505 | static const struct i2c_device_id aat2870_i2c_id_table[] = { |
504 | 506 | { "aat2870", 0 }, |
505 | 507 | { } |
506 | 508 | |
... | ... | @@ -510,11 +512,10 @@ |
510 | 512 | .driver = { |
511 | 513 | .name = "aat2870", |
512 | 514 | .owner = THIS_MODULE, |
515 | + .pm = &aat2870_pm_ops, | |
513 | 516 | }, |
514 | 517 | .probe = aat2870_i2c_probe, |
515 | 518 | .remove = aat2870_i2c_remove, |
516 | - .suspend = aat2870_i2c_suspend, | |
517 | - .resume = aat2870_i2c_resume, | |
518 | 519 | .id_table = aat2870_i2c_id_table, |
519 | 520 | }; |
520 | 521 |