diff options
Diffstat (limited to 'drivers/rtc/rtc-imxdi.c')
-rw-r--r-- | drivers/rtc/rtc-imxdi.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c index 82aad695979e..d3a8c8e255de 100644 --- a/drivers/rtc/rtc-imxdi.c +++ b/drivers/rtc/rtc-imxdi.c | |||
@@ -369,7 +369,7 @@ static void dryice_work(struct work_struct *work) | |||
369 | /* | 369 | /* |
370 | * probe for dryice rtc device | 370 | * probe for dryice rtc device |
371 | */ | 371 | */ |
372 | static int dryice_rtc_probe(struct platform_device *pdev) | 372 | static int __init dryice_rtc_probe(struct platform_device *pdev) |
373 | { | 373 | { |
374 | struct resource *res; | 374 | struct resource *res; |
375 | struct imxdi_dev *imxdi; | 375 | struct imxdi_dev *imxdi; |
@@ -464,7 +464,7 @@ static int dryice_rtc_probe(struct platform_device *pdev) | |||
464 | } | 464 | } |
465 | 465 | ||
466 | platform_set_drvdata(pdev, imxdi); | 466 | platform_set_drvdata(pdev, imxdi); |
467 | imxdi->rtc = rtc_device_register(pdev->name, &pdev->dev, | 467 | imxdi->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, |
468 | &dryice_rtc_ops, THIS_MODULE); | 468 | &dryice_rtc_ops, THIS_MODULE); |
469 | if (IS_ERR(imxdi->rtc)) { | 469 | if (IS_ERR(imxdi->rtc)) { |
470 | rc = PTR_ERR(imxdi->rtc); | 470 | rc = PTR_ERR(imxdi->rtc); |
@@ -479,7 +479,7 @@ err: | |||
479 | return rc; | 479 | return rc; |
480 | } | 480 | } |
481 | 481 | ||
482 | static int dryice_rtc_remove(struct platform_device *pdev) | 482 | static int __exit dryice_rtc_remove(struct platform_device *pdev) |
483 | { | 483 | { |
484 | struct imxdi_dev *imxdi = platform_get_drvdata(pdev); | 484 | struct imxdi_dev *imxdi = platform_get_drvdata(pdev); |
485 | 485 | ||
@@ -488,8 +488,6 @@ static int dryice_rtc_remove(struct platform_device *pdev) | |||
488 | /* mask all interrupts */ | 488 | /* mask all interrupts */ |
489 | __raw_writel(0, imxdi->ioaddr + DIER); | 489 | __raw_writel(0, imxdi->ioaddr + DIER); |
490 | 490 | ||
491 | rtc_device_unregister(imxdi->rtc); | ||
492 | |||
493 | clk_disable_unprepare(imxdi->clk); | 491 | clk_disable_unprepare(imxdi->clk); |
494 | 492 | ||
495 | return 0; | 493 | return 0; |
@@ -510,21 +508,10 @@ static struct platform_driver dryice_rtc_driver = { | |||
510 | .owner = THIS_MODULE, | 508 | .owner = THIS_MODULE, |
511 | .of_match_table = of_match_ptr(dryice_dt_ids), | 509 | .of_match_table = of_match_ptr(dryice_dt_ids), |
512 | }, | 510 | }, |
513 | .remove = dryice_rtc_remove, | 511 | .remove = __exit_p(dryice_rtc_remove), |
514 | }; | 512 | }; |
515 | 513 | ||
516 | static int __init dryice_rtc_init(void) | 514 | module_platform_driver_probe(dryice_rtc_driver, dryice_rtc_probe); |
517 | { | ||
518 | return platform_driver_probe(&dryice_rtc_driver, dryice_rtc_probe); | ||
519 | } | ||
520 | |||
521 | static void __exit dryice_rtc_exit(void) | ||
522 | { | ||
523 | platform_driver_unregister(&dryice_rtc_driver); | ||
524 | } | ||
525 | |||
526 | module_init(dryice_rtc_init); | ||
527 | module_exit(dryice_rtc_exit); | ||
528 | 515 | ||
529 | MODULE_AUTHOR("Freescale Semiconductor, Inc."); | 516 | MODULE_AUTHOR("Freescale Semiconductor, Inc."); |
530 | MODULE_AUTHOR("Baruch Siach <baruch@tkos.co.il>"); | 517 | MODULE_AUTHOR("Baruch Siach <baruch@tkos.co.il>"); |