aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-spear.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 19:21:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 21:28:39 -0400
commitb086e392b1d435f6abc1dab32b21ee5559cb53de (patch)
tree7dd512651cc68d576cb5209e62bcbdaa9de88a58 /drivers/rtc/rtc-spear.c
parent5936fdb9b267990158601b634bcc959cef39d33f (diff)
rtc: rtc-spear: convert spear_rtc_driver to dev_pm_ops
Instead of using legacy suspend/resume methods, using newer dev_pm_ops structure allows better control over power management. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-spear.c')
-rw-r--r--drivers/rtc/rtc-spear.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index db3ef610dd7c..574359c48f65 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -434,10 +434,10 @@ static int spear_rtc_remove(struct platform_device *pdev)
434 return 0; 434 return 0;
435} 435}
436 436
437#ifdef CONFIG_PM 437#ifdef CONFIG_PM_SLEEP
438 438static int spear_rtc_suspend(struct device *dev)
439static int spear_rtc_suspend(struct platform_device *pdev, pm_message_t state)
440{ 439{
440 struct platform_device *pdev = to_platform_device(dev);
441 struct spear_rtc_config *config = platform_get_drvdata(pdev); 441 struct spear_rtc_config *config = platform_get_drvdata(pdev);
442 int irq; 442 int irq;
443 443
@@ -453,8 +453,9 @@ static int spear_rtc_suspend(struct platform_device *pdev, pm_message_t state)
453 return 0; 453 return 0;
454} 454}
455 455
456static int spear_rtc_resume(struct platform_device *pdev) 456static int spear_rtc_resume(struct device *dev)
457{ 457{
458 struct platform_device *pdev = to_platform_device(dev);
458 struct spear_rtc_config *config = platform_get_drvdata(pdev); 459 struct spear_rtc_config *config = platform_get_drvdata(pdev);
459 int irq; 460 int irq;
460 461
@@ -472,12 +473,10 @@ static int spear_rtc_resume(struct platform_device *pdev)
472 473
473 return 0; 474 return 0;
474} 475}
475
476#else
477#define spear_rtc_suspend NULL
478#define spear_rtc_resume NULL
479#endif 476#endif
480 477
478static SIMPLE_DEV_PM_OPS(spear_rtc_pm_ops, spear_rtc_suspend, spear_rtc_resume);
479
481static void spear_rtc_shutdown(struct platform_device *pdev) 480static void spear_rtc_shutdown(struct platform_device *pdev)
482{ 481{
483 struct spear_rtc_config *config = platform_get_drvdata(pdev); 482 struct spear_rtc_config *config = platform_get_drvdata(pdev);
@@ -497,11 +496,10 @@ MODULE_DEVICE_TABLE(of, spear_rtc_id_table);
497static struct platform_driver spear_rtc_driver = { 496static struct platform_driver spear_rtc_driver = {
498 .probe = spear_rtc_probe, 497 .probe = spear_rtc_probe,
499 .remove = spear_rtc_remove, 498 .remove = spear_rtc_remove,
500 .suspend = spear_rtc_suspend,
501 .resume = spear_rtc_resume,
502 .shutdown = spear_rtc_shutdown, 499 .shutdown = spear_rtc_shutdown,
503 .driver = { 500 .driver = {
504 .name = "rtc-spear", 501 .name = "rtc-spear",
502 .pm = &spear_rtc_pm_ops,
505 .of_match_table = of_match_ptr(spear_rtc_id_table), 503 .of_match_table = of_match_ptr(spear_rtc_id_table),
506 }, 504 },
507}; 505};