diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-08 15:48:15 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2012-07-22 00:48:44 -0400 |
commit | 08cd6753d96aebcceebe10800fede1e4830e2a48 (patch) | |
tree | 450e0ad9fdd6c476b0cb267d1445c163f9c7d790 /drivers/hwmon | |
parent | 6d20a6c060c41a7a9c8f5bd4b9d44b8f13b78694 (diff) |
hwmon: (exynos4_tmu) Use struct dev_pm_ops for power management
Make the Exynos4 TMU driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct platform_driver.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
[linux@roeck-us.net: CONFIG_PM->CONFIG_PM_SLEEP, and remove unnecessary ()]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/exynos4_tmu.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/hwmon/exynos4_tmu.c b/drivers/hwmon/exynos4_tmu.c index f2359a0093bd..e912059140cd 100644 --- a/drivers/hwmon/exynos4_tmu.c +++ b/drivers/hwmon/exynos4_tmu.c | |||
@@ -475,35 +475,39 @@ static int __devexit exynos4_tmu_remove(struct platform_device *pdev) | |||
475 | return 0; | 475 | return 0; |
476 | } | 476 | } |
477 | 477 | ||
478 | #ifdef CONFIG_PM | 478 | #ifdef CONFIG_PM_SLEEP |
479 | static int exynos4_tmu_suspend(struct platform_device *pdev, pm_message_t state) | 479 | static int exynos4_tmu_suspend(struct device *dev) |
480 | { | 480 | { |
481 | exynos4_tmu_control(pdev, false); | 481 | exynos4_tmu_control(to_platform_device(dev), false); |
482 | 482 | ||
483 | return 0; | 483 | return 0; |
484 | } | 484 | } |
485 | 485 | ||
486 | static int exynos4_tmu_resume(struct platform_device *pdev) | 486 | static int exynos4_tmu_resume(struct device *dev) |
487 | { | 487 | { |
488 | struct platform_device *pdev = to_platform_device(dev); | ||
489 | |||
488 | exynos4_tmu_initialize(pdev); | 490 | exynos4_tmu_initialize(pdev); |
489 | exynos4_tmu_control(pdev, true); | 491 | exynos4_tmu_control(pdev, true); |
490 | 492 | ||
491 | return 0; | 493 | return 0; |
492 | } | 494 | } |
495 | |||
496 | static SIMPLE_DEV_PM_OPS(exynos4_tmu_pm, | ||
497 | exynos4_tmu_suspend, exynos4_tmu_resume); | ||
498 | #define EXYNOS4_TMU_PM &exynos4_tmu_pm | ||
493 | #else | 499 | #else |
494 | #define exynos4_tmu_suspend NULL | 500 | #define EXYNOS4_TMU_PM NULL |
495 | #define exynos4_tmu_resume NULL | ||
496 | #endif | 501 | #endif |
497 | 502 | ||
498 | static struct platform_driver exynos4_tmu_driver = { | 503 | static struct platform_driver exynos4_tmu_driver = { |
499 | .driver = { | 504 | .driver = { |
500 | .name = "exynos4-tmu", | 505 | .name = "exynos4-tmu", |
501 | .owner = THIS_MODULE, | 506 | .owner = THIS_MODULE, |
507 | .pm = EXYNOS4_TMU_PM, | ||
502 | }, | 508 | }, |
503 | .probe = exynos4_tmu_probe, | 509 | .probe = exynos4_tmu_probe, |
504 | .remove = __devexit_p(exynos4_tmu_remove), | 510 | .remove = __devexit_p(exynos4_tmu_remove), |
505 | .suspend = exynos4_tmu_suspend, | ||
506 | .resume = exynos4_tmu_resume, | ||
507 | }; | 511 | }; |
508 | 512 | ||
509 | module_platform_driver(exynos4_tmu_driver); | 513 | module_platform_driver(exynos4_tmu_driver); |