Skip to content

Commit

Permalink
rtc: rtc-imxdi: use devm_clk_get()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jingoo Han authored and Linus Torvalds committed Feb 22, 2013
1 parent ee44335 commit 9510853
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/rtc/rtc-imxdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 9510853

Please sign in to comment.