rtc: rtc-imxdi: use devm_clk_get()
authorJingoo Han <jg1.han@samsung.com>
Fri, 22 Feb 2013 00:45:35 +0000 (16:45 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 22 Feb 2013 01:22:30 +0000 (17:22 -0800)
Use devm_clk_get() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-imxdi.c

index 75d307ab37f47ee67c1d8f3815ceced1a9ac4d20..82aad695979e7dc1078a5ea42d89f0ea9b0449cd 100644 (file)
@@ -406,7 +406,7 @@ static int dryice_rtc_probe(struct platform_device *pdev)
 
        mutex_init(&imxdi->write_mutex);
 
-       imxdi->clk = clk_get(&pdev->dev, NULL);
+       imxdi->clk = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(imxdi->clk))
                return PTR_ERR(imxdi->clk);
        clk_prepare_enable(imxdi->clk);
@@ -475,7 +475,6 @@ static int dryice_rtc_probe(struct platform_device *pdev)
 
 err:
        clk_disable_unprepare(imxdi->clk);
-       clk_put(imxdi->clk);
 
        return rc;
 }
@@ -492,7 +491,6 @@ static int dryice_rtc_remove(struct platform_device *pdev)
        rtc_device_unregister(imxdi->rtc);
 
        clk_disable_unprepare(imxdi->clk);
-       clk_put(imxdi->clk);
 
        return 0;
 }