diff options
Diffstat (limited to 'drivers/rtc/rtc-mxc.c')
-rw-r--r-- | drivers/rtc/rtc-mxc.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c index e3e50d69baf8..cd0106293a49 100644 --- a/drivers/rtc/rtc-mxc.c +++ b/drivers/rtc/rtc-mxc.c | |||
@@ -343,7 +343,7 @@ static struct rtc_class_ops mxc_rtc_ops = { | |||
343 | .alarm_irq_enable = mxc_rtc_alarm_irq_enable, | 343 | .alarm_irq_enable = mxc_rtc_alarm_irq_enable, |
344 | }; | 344 | }; |
345 | 345 | ||
346 | static int __init mxc_rtc_probe(struct platform_device *pdev) | 346 | static int __devinit mxc_rtc_probe(struct platform_device *pdev) |
347 | { | 347 | { |
348 | struct resource *res; | 348 | struct resource *res; |
349 | struct rtc_device *rtc; | 349 | struct rtc_device *rtc; |
@@ -367,14 +367,14 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) | |||
367 | pdata->ioaddr = devm_ioremap(&pdev->dev, res->start, | 367 | pdata->ioaddr = devm_ioremap(&pdev->dev, res->start, |
368 | resource_size(res)); | 368 | resource_size(res)); |
369 | 369 | ||
370 | pdata->clk = clk_get(&pdev->dev, "rtc"); | 370 | pdata->clk = devm_clk_get(&pdev->dev, NULL); |
371 | if (IS_ERR(pdata->clk)) { | 371 | if (IS_ERR(pdata->clk)) { |
372 | dev_err(&pdev->dev, "unable to get clock!\n"); | 372 | dev_err(&pdev->dev, "unable to get clock!\n"); |
373 | ret = PTR_ERR(pdata->clk); | 373 | ret = PTR_ERR(pdata->clk); |
374 | goto exit_free_pdata; | 374 | goto exit_free_pdata; |
375 | } | 375 | } |
376 | 376 | ||
377 | clk_enable(pdata->clk); | 377 | clk_prepare_enable(pdata->clk); |
378 | rate = clk_get_rate(pdata->clk); | 378 | rate = clk_get_rate(pdata->clk); |
379 | 379 | ||
380 | if (rate == 32768) | 380 | if (rate == 32768) |
@@ -426,22 +426,20 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) | |||
426 | exit_clr_drvdata: | 426 | exit_clr_drvdata: |
427 | platform_set_drvdata(pdev, NULL); | 427 | platform_set_drvdata(pdev, NULL); |
428 | exit_put_clk: | 428 | exit_put_clk: |
429 | clk_disable(pdata->clk); | 429 | clk_disable_unprepare(pdata->clk); |
430 | clk_put(pdata->clk); | ||
431 | 430 | ||
432 | exit_free_pdata: | 431 | exit_free_pdata: |
433 | 432 | ||
434 | return ret; | 433 | return ret; |
435 | } | 434 | } |
436 | 435 | ||
437 | static int __exit mxc_rtc_remove(struct platform_device *pdev) | 436 | static int __devexit mxc_rtc_remove(struct platform_device *pdev) |
438 | { | 437 | { |
439 | struct rtc_plat_data *pdata = platform_get_drvdata(pdev); | 438 | struct rtc_plat_data *pdata = platform_get_drvdata(pdev); |
440 | 439 | ||
441 | rtc_device_unregister(pdata->rtc); | 440 | rtc_device_unregister(pdata->rtc); |
442 | 441 | ||
443 | clk_disable(pdata->clk); | 442 | clk_disable_unprepare(pdata->clk); |
444 | clk_put(pdata->clk); | ||
445 | platform_set_drvdata(pdev, NULL); | 443 | platform_set_drvdata(pdev, NULL); |
446 | 444 | ||
447 | return 0; | 445 | return 0; |
@@ -482,21 +480,11 @@ static struct platform_driver mxc_rtc_driver = { | |||
482 | #endif | 480 | #endif |
483 | .owner = THIS_MODULE, | 481 | .owner = THIS_MODULE, |
484 | }, | 482 | }, |
485 | .remove = __exit_p(mxc_rtc_remove), | 483 | .probe = mxc_rtc_probe, |
484 | .remove = __devexit_p(mxc_rtc_remove), | ||
486 | }; | 485 | }; |
487 | 486 | ||
488 | static int __init mxc_rtc_init(void) | 487 | module_platform_driver(mxc_rtc_driver) |
489 | { | ||
490 | return platform_driver_probe(&mxc_rtc_driver, mxc_rtc_probe); | ||
491 | } | ||
492 | |||
493 | static void __exit mxc_rtc_exit(void) | ||
494 | { | ||
495 | platform_driver_unregister(&mxc_rtc_driver); | ||
496 | } | ||
497 | |||
498 | module_init(mxc_rtc_init); | ||
499 | module_exit(mxc_rtc_exit); | ||
500 | 488 | ||
501 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); | 489 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); |
502 | MODULE_DESCRIPTION("RTC driver for Freescale MXC"); | 490 | MODULE_DESCRIPTION("RTC driver for Freescale MXC"); |