diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:20:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:39 -0400 |
commit | b4df8f6ca1d93a89b67dd29a785757f289475729 (patch) | |
tree | 6ee301ebeb75fac3e38657346914af0efda5e6ee /drivers | |
parent | 4dc8eb13c2b99a334ee703061e75ee71d582dd1f (diff) |
rtc: rtc-bfin: convert bfin_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')
-rw-r--r-- | drivers/rtc/rtc-bfin.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index d8b06f50ad51..ad44ec5dc29a 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c | |||
@@ -396,11 +396,9 @@ static int bfin_rtc_remove(struct platform_device *pdev) | |||
396 | return 0; | 396 | return 0; |
397 | } | 397 | } |
398 | 398 | ||
399 | #ifdef CONFIG_PM | 399 | #ifdef CONFIG_PM_SLEEP |
400 | static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state) | 400 | static int bfin_rtc_suspend(struct device *dev) |
401 | { | 401 | { |
402 | struct device *dev = &pdev->dev; | ||
403 | |||
404 | dev_dbg_stamp(dev); | 402 | dev_dbg_stamp(dev); |
405 | 403 | ||
406 | if (device_may_wakeup(dev)) { | 404 | if (device_may_wakeup(dev)) { |
@@ -412,10 +410,8 @@ static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state) | |||
412 | return 0; | 410 | return 0; |
413 | } | 411 | } |
414 | 412 | ||
415 | static int bfin_rtc_resume(struct platform_device *pdev) | 413 | static int bfin_rtc_resume(struct device *dev) |
416 | { | 414 | { |
417 | struct device *dev = &pdev->dev; | ||
418 | |||
419 | dev_dbg_stamp(dev); | 415 | dev_dbg_stamp(dev); |
420 | 416 | ||
421 | if (device_may_wakeup(dev)) | 417 | if (device_may_wakeup(dev)) |
@@ -434,20 +430,18 @@ static int bfin_rtc_resume(struct platform_device *pdev) | |||
434 | 430 | ||
435 | return 0; | 431 | return 0; |
436 | } | 432 | } |
437 | #else | ||
438 | # define bfin_rtc_suspend NULL | ||
439 | # define bfin_rtc_resume NULL | ||
440 | #endif | 433 | #endif |
441 | 434 | ||
435 | static SIMPLE_DEV_PM_OPS(bfin_rtc_pm_ops, bfin_rtc_suspend, bfin_rtc_resume); | ||
436 | |||
442 | static struct platform_driver bfin_rtc_driver = { | 437 | static struct platform_driver bfin_rtc_driver = { |
443 | .driver = { | 438 | .driver = { |
444 | .name = "rtc-bfin", | 439 | .name = "rtc-bfin", |
445 | .owner = THIS_MODULE, | 440 | .owner = THIS_MODULE, |
441 | .pm = &bfin_rtc_pm_ops, | ||
446 | }, | 442 | }, |
447 | .probe = bfin_rtc_probe, | 443 | .probe = bfin_rtc_probe, |
448 | .remove = bfin_rtc_remove, | 444 | .remove = bfin_rtc_remove, |
449 | .suspend = bfin_rtc_suspend, | ||
450 | .resume = bfin_rtc_resume, | ||
451 | }; | 445 | }; |
452 | 446 | ||
453 | module_platform_driver(bfin_rtc_driver); | 447 | module_platform_driver(bfin_rtc_driver); |