diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2013-04-29 19:19:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:28 -0400 |
commit | 3443ad095fc330ace0ef23bf965354a56298bf58 (patch) | |
tree | 35f7457e947488d31fb41273f1bcc8b864b76135 | |
parent | 38a6276e2b56921a407e718079aee79919873d72 (diff) |
drivers/rtc/rtc-tegra.c: use struct dev_pm_ops for power management
Make the Tegra RTC controller 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: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/rtc/rtc-tegra.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c index 916802a58366..0ef028b54821 100644 --- a/drivers/rtc/rtc-tegra.c +++ b/drivers/rtc/rtc-tegra.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
27 | #include <linux/rtc.h> | 27 | #include <linux/rtc.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/pm.h> | ||
29 | 30 | ||
30 | /* set to 1 = busy every eight 32kHz clocks during copy of sec+msec to AHB */ | 31 | /* set to 1 = busy every eight 32kHz clocks during copy of sec+msec to AHB */ |
31 | #define TEGRA_RTC_REG_BUSY 0x004 | 32 | #define TEGRA_RTC_REG_BUSY 0x004 |
@@ -391,10 +392,9 @@ static int __exit tegra_rtc_remove(struct platform_device *pdev) | |||
391 | } | 392 | } |
392 | 393 | ||
393 | #ifdef CONFIG_PM_SLEEP | 394 | #ifdef CONFIG_PM_SLEEP |
394 | static int tegra_rtc_suspend(struct platform_device *pdev, pm_message_t state) | 395 | static int tegra_rtc_suspend(struct device *dev) |
395 | { | 396 | { |
396 | struct device *dev = &pdev->dev; | 397 | struct tegra_rtc_info *info = dev_get_drvdata(dev); |
397 | struct tegra_rtc_info *info = platform_get_drvdata(pdev); | ||
398 | 398 | ||
399 | tegra_rtc_wait_while_busy(dev); | 399 | tegra_rtc_wait_while_busy(dev); |
400 | 400 | ||
@@ -416,10 +416,9 @@ static int tegra_rtc_suspend(struct platform_device *pdev, pm_message_t state) | |||
416 | return 0; | 416 | return 0; |
417 | } | 417 | } |
418 | 418 | ||
419 | static int tegra_rtc_resume(struct platform_device *pdev) | 419 | static int tegra_rtc_resume(struct device *dev) |
420 | { | 420 | { |
421 | struct device *dev = &pdev->dev; | 421 | struct tegra_rtc_info *info = dev_get_drvdata(dev); |
422 | struct tegra_rtc_info *info = platform_get_drvdata(pdev); | ||
423 | 422 | ||
424 | dev_vdbg(dev, "Resume (device_may_wakeup=%d)\n", | 423 | dev_vdbg(dev, "Resume (device_may_wakeup=%d)\n", |
425 | device_may_wakeup(dev)); | 424 | device_may_wakeup(dev)); |
@@ -431,6 +430,8 @@ static int tegra_rtc_resume(struct platform_device *pdev) | |||
431 | } | 430 | } |
432 | #endif | 431 | #endif |
433 | 432 | ||
433 | static SIMPLE_DEV_PM_OPS(tegra_rtc_pm_ops, tegra_rtc_suspend, tegra_rtc_resume); | ||
434 | |||
434 | static void tegra_rtc_shutdown(struct platform_device *pdev) | 435 | static void tegra_rtc_shutdown(struct platform_device *pdev) |
435 | { | 436 | { |
436 | dev_vdbg(&pdev->dev, "disabling interrupts.\n"); | 437 | dev_vdbg(&pdev->dev, "disabling interrupts.\n"); |
@@ -445,11 +446,8 @@ static struct platform_driver tegra_rtc_driver = { | |||
445 | .name = "tegra_rtc", | 446 | .name = "tegra_rtc", |
446 | .owner = THIS_MODULE, | 447 | .owner = THIS_MODULE, |
447 | .of_match_table = tegra_rtc_dt_match, | 448 | .of_match_table = tegra_rtc_dt_match, |
449 | .pm = &tegra_rtc_pm_ops, | ||
448 | }, | 450 | }, |
449 | #ifdef CONFIG_PM_SLEEP | ||
450 | .suspend = tegra_rtc_suspend, | ||
451 | .resume = tegra_rtc_resume, | ||
452 | #endif | ||
453 | }; | 451 | }; |
454 | 452 | ||
455 | module_platform_driver_probe(tegra_rtc_driver, tegra_rtc_probe); | 453 | module_platform_driver_probe(tegra_rtc_driver, tegra_rtc_probe); |