diff options
Diffstat (limited to 'drivers/rtc/rtc-imxdi.c')
-rw-r--r-- | drivers/rtc/rtc-imxdi.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c index 4eed51044c5d..82aad695979e 100644 --- a/drivers/rtc/rtc-imxdi.c +++ b/drivers/rtc/rtc-imxdi.c | |||
@@ -36,7 +36,9 @@ | |||
36 | #include <linux/platform_device.h> | 36 | #include <linux/platform_device.h> |
37 | #include <linux/rtc.h> | 37 | #include <linux/rtc.h> |
38 | #include <linux/sched.h> | 38 | #include <linux/sched.h> |
39 | #include <linux/spinlock.h> | ||
39 | #include <linux/workqueue.h> | 40 | #include <linux/workqueue.h> |
41 | #include <linux/of.h> | ||
40 | 42 | ||
41 | /* DryIce Register Definitions */ | 43 | /* DryIce Register Definitions */ |
42 | 44 | ||
@@ -404,7 +406,7 @@ static int dryice_rtc_probe(struct platform_device *pdev) | |||
404 | 406 | ||
405 | mutex_init(&imxdi->write_mutex); | 407 | mutex_init(&imxdi->write_mutex); |
406 | 408 | ||
407 | imxdi->clk = clk_get(&pdev->dev, NULL); | 409 | imxdi->clk = devm_clk_get(&pdev->dev, NULL); |
408 | if (IS_ERR(imxdi->clk)) | 410 | if (IS_ERR(imxdi->clk)) |
409 | return PTR_ERR(imxdi->clk); | 411 | return PTR_ERR(imxdi->clk); |
410 | clk_prepare_enable(imxdi->clk); | 412 | clk_prepare_enable(imxdi->clk); |
@@ -473,12 +475,11 @@ static int dryice_rtc_probe(struct platform_device *pdev) | |||
473 | 475 | ||
474 | err: | 476 | err: |
475 | clk_disable_unprepare(imxdi->clk); | 477 | clk_disable_unprepare(imxdi->clk); |
476 | clk_put(imxdi->clk); | ||
477 | 478 | ||
478 | return rc; | 479 | return rc; |
479 | } | 480 | } |
480 | 481 | ||
481 | static int __devexit dryice_rtc_remove(struct platform_device *pdev) | 482 | static int dryice_rtc_remove(struct platform_device *pdev) |
482 | { | 483 | { |
483 | struct imxdi_dev *imxdi = platform_get_drvdata(pdev); | 484 | struct imxdi_dev *imxdi = platform_get_drvdata(pdev); |
484 | 485 | ||
@@ -490,17 +491,26 @@ static int __devexit dryice_rtc_remove(struct platform_device *pdev) | |||
490 | rtc_device_unregister(imxdi->rtc); | 491 | rtc_device_unregister(imxdi->rtc); |
491 | 492 | ||
492 | clk_disable_unprepare(imxdi->clk); | 493 | clk_disable_unprepare(imxdi->clk); |
493 | clk_put(imxdi->clk); | ||
494 | 494 | ||
495 | return 0; | 495 | return 0; |
496 | } | 496 | } |
497 | 497 | ||
498 | #ifdef CONFIG_OF | ||
499 | static const struct of_device_id dryice_dt_ids[] = { | ||
500 | { .compatible = "fsl,imx25-rtc" }, | ||
501 | { /* sentinel */ } | ||
502 | }; | ||
503 | |||
504 | MODULE_DEVICE_TABLE(of, dryice_dt_ids); | ||
505 | #endif | ||
506 | |||
498 | static struct platform_driver dryice_rtc_driver = { | 507 | static struct platform_driver dryice_rtc_driver = { |
499 | .driver = { | 508 | .driver = { |
500 | .name = "imxdi_rtc", | 509 | .name = "imxdi_rtc", |
501 | .owner = THIS_MODULE, | 510 | .owner = THIS_MODULE, |
511 | .of_match_table = of_match_ptr(dryice_dt_ids), | ||
502 | }, | 512 | }, |
503 | .remove = __devexit_p(dryice_rtc_remove), | 513 | .remove = dryice_rtc_remove, |
504 | }; | 514 | }; |
505 | 515 | ||
506 | static int __init dryice_rtc_init(void) | 516 | static int __init dryice_rtc_init(void) |