diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2012-10-04 20:14:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:05:04 -0400 |
commit | 0f3cde536d5015a918c4b3fd55fbe335428096e5 (patch) | |
tree | 35cab5c76c4808d0c5c9f169e081e85d5bd76038 /drivers/rtc/rtc-mxc.c | |
parent | 828296debf7853752e47b6abfa608ab0172e53ec (diff) |
rtc: rtc-mxc: adapt to the new i.mx clock framework
i.mx drivers should use clk_prepare_enable/clk_disable_unprepare() in
order to avoid clk warnings.
While at it, convert to devm_clk_get() since other devm_ functions are
used in this driver and it can also save some clk_put() calls.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-mxc.c')
-rw-r--r-- | drivers/rtc/rtc-mxc.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c index e3e50d69baf8..334c43e0ce0e 100644 --- a/drivers/rtc/rtc-mxc.c +++ b/drivers/rtc/rtc-mxc.c | |||
@@ -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,8 +426,7 @@ 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 | ||
@@ -440,8 +439,7 @@ static int __exit mxc_rtc_remove(struct platform_device *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; |