aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/rtc/rtc-bfin.c18
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
400static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state) 400static 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
415static int bfin_rtc_resume(struct platform_device *pdev) 413static 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
435static SIMPLE_DEV_PM_OPS(bfin_rtc_pm_ops, bfin_rtc_suspend, bfin_rtc_resume);
436
442static struct platform_driver bfin_rtc_driver = { 437static 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
453module_platform_driver(bfin_rtc_driver); 447module_platform_driver(bfin_rtc_driver);