From: Jingoo Han Date: Fri, 22 Feb 2013 00:45:38 +0000 (-0800) Subject: rtc: rtc-coh901331: use devm_clk_get() X-Git-Tag: Ubuntu-5.0.0-8.9~14293^2~7 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=3b759d7f749f09617814587d4f2f448d8432afcb;p=mirror_ubuntu-disco-kernel.git rtc: rtc-coh901331: use devm_clk_get() Use devm_clk_get() to make cleanup paths more simple. Signed-off-by: Jingoo Han Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c index c8115b83e5ab..2d28ec1aa1cd 100644 --- a/drivers/rtc/rtc-coh901331.c +++ b/drivers/rtc/rtc-coh901331.c @@ -157,7 +157,6 @@ static int __exit coh901331_remove(struct platform_device *pdev) if (rtap) { rtc_device_unregister(rtap->rtc); clk_unprepare(rtap->clk); - clk_put(rtap->clk); platform_set_drvdata(pdev, NULL); } @@ -196,7 +195,7 @@ static int __init coh901331_probe(struct platform_device *pdev) "RTC COH 901 331 Alarm", rtap)) return -EIO; - rtap->clk = clk_get(&pdev->dev, NULL); + rtap->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(rtap->clk)) { ret = PTR_ERR(rtap->clk); dev_err(&pdev->dev, "could not get clock\n"); @@ -207,7 +206,7 @@ static int __init coh901331_probe(struct platform_device *pdev) ret = clk_prepare_enable(rtap->clk); if (ret) { dev_err(&pdev->dev, "could not enable clock\n"); - goto out_no_clk_prepenable; + return ret; } clk_disable(rtap->clk); @@ -224,8 +223,6 @@ static int __init coh901331_probe(struct platform_device *pdev) out_no_rtc: platform_set_drvdata(pdev, NULL); clk_unprepare(rtap->clk); - out_no_clk_prepenable: - clk_put(rtap->clk); return ret; }