aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-mxc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-mxc.c')
-rw-r--r--drivers/rtc/rtc-mxc.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 1c3ef7289565..9a3895bc4f4d 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -439,7 +439,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
439 if (pdata->irq >=0) 439 if (pdata->irq >=0)
440 device_init_wakeup(&pdev->dev, 1); 440 device_init_wakeup(&pdev->dev, 1);
441 441
442 rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops, 442 rtc = devm_rtc_device_register(&pdev->dev, pdev->name, &mxc_rtc_ops,
443 THIS_MODULE); 443 THIS_MODULE);
444 if (IS_ERR(rtc)) { 444 if (IS_ERR(rtc)) {
445 ret = PTR_ERR(rtc); 445 ret = PTR_ERR(rtc);
@@ -464,15 +464,13 @@ static int mxc_rtc_remove(struct platform_device *pdev)
464{ 464{
465 struct rtc_plat_data *pdata = platform_get_drvdata(pdev); 465 struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
466 466
467 rtc_device_unregister(pdata->rtc);
468
469 clk_disable_unprepare(pdata->clk); 467 clk_disable_unprepare(pdata->clk);
470 platform_set_drvdata(pdev, NULL); 468 platform_set_drvdata(pdev, NULL);
471 469
472 return 0; 470 return 0;
473} 471}
474 472
475#ifdef CONFIG_PM 473#ifdef CONFIG_PM_SLEEP
476static int mxc_rtc_suspend(struct device *dev) 474static int mxc_rtc_suspend(struct device *dev)
477{ 475{
478 struct rtc_plat_data *pdata = dev_get_drvdata(dev); 476 struct rtc_plat_data *pdata = dev_get_drvdata(dev);
@@ -492,19 +490,14 @@ static int mxc_rtc_resume(struct device *dev)
492 490
493 return 0; 491 return 0;
494} 492}
495
496static struct dev_pm_ops mxc_rtc_pm_ops = {
497 .suspend = mxc_rtc_suspend,
498 .resume = mxc_rtc_resume,
499};
500#endif 493#endif
501 494
495static SIMPLE_DEV_PM_OPS(mxc_rtc_pm_ops, mxc_rtc_suspend, mxc_rtc_resume);
496
502static struct platform_driver mxc_rtc_driver = { 497static struct platform_driver mxc_rtc_driver = {
503 .driver = { 498 .driver = {
504 .name = "mxc_rtc", 499 .name = "mxc_rtc",
505#ifdef CONFIG_PM
506 .pm = &mxc_rtc_pm_ops, 500 .pm = &mxc_rtc_pm_ops,
507#endif
508 .owner = THIS_MODULE, 501 .owner = THIS_MODULE,
509 }, 502 },
510 .id_table = imx_rtc_devtype, 503 .id_table = imx_rtc_devtype,