Commit 3b759d7f authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

rtc: rtc-coh901331: use devm_clk_get()

Use devm_clk_get() to make cleanup paths more simple.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0db29c1d
...@@ -157,7 +157,6 @@ static int __exit coh901331_remove(struct platform_device *pdev) ...@@ -157,7 +157,6 @@ static int __exit coh901331_remove(struct platform_device *pdev)
if (rtap) { if (rtap) {
rtc_device_unregister(rtap->rtc); rtc_device_unregister(rtap->rtc);
clk_unprepare(rtap->clk); clk_unprepare(rtap->clk);
clk_put(rtap->clk);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
} }
...@@ -196,7 +195,7 @@ static int __init coh901331_probe(struct platform_device *pdev) ...@@ -196,7 +195,7 @@ static int __init coh901331_probe(struct platform_device *pdev)
"RTC COH 901 331 Alarm", rtap)) "RTC COH 901 331 Alarm", rtap))
return -EIO; return -EIO;
rtap->clk = clk_get(&pdev->dev, NULL); rtap->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(rtap->clk)) { if (IS_ERR(rtap->clk)) {
ret = PTR_ERR(rtap->clk); ret = PTR_ERR(rtap->clk);
dev_err(&pdev->dev, "could not get clock\n"); dev_err(&pdev->dev, "could not get clock\n");
...@@ -207,7 +206,7 @@ static int __init coh901331_probe(struct platform_device *pdev) ...@@ -207,7 +206,7 @@ static int __init coh901331_probe(struct platform_device *pdev)
ret = clk_prepare_enable(rtap->clk); ret = clk_prepare_enable(rtap->clk);
if (ret) { if (ret) {
dev_err(&pdev->dev, "could not enable clock\n"); dev_err(&pdev->dev, "could not enable clock\n");
goto out_no_clk_prepenable; return ret;
} }
clk_disable(rtap->clk); clk_disable(rtap->clk);
...@@ -224,8 +223,6 @@ static int __init coh901331_probe(struct platform_device *pdev) ...@@ -224,8 +223,6 @@ static int __init coh901331_probe(struct platform_device *pdev)
out_no_rtc: out_no_rtc:
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
clk_unprepare(rtap->clk); clk_unprepare(rtap->clk);
out_no_clk_prepenable:
clk_put(rtap->clk);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment