]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drivers/rtc/rtc-coh901331.c: use clk_prepare_enable() and clk_disable_unprepare()
authorJulia Lawall <Julia.Lawall@lip6.fr>
Fri, 21 Sep 2012 01:02:19 +0000 (11:02 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 21 Sep 2012 05:59:19 +0000 (15:59 +1000)
commit00c8db68668d0508543f90d27fb6e211d52594aa
tree25bb56205bd826ed51bfb12b9f587c7ba7f6f44f
parent52ce72eddcb70b17c479a8998c868f4f50eba3ff
drivers/rtc/rtc-coh901331.c: use clk_prepare_enable() and clk_disable_unprepare()

clk_prepare_enable and clk_disable_unprepare combine clk_prepare and
clk_enable, and clk_disable and clk_unprepare.  They make the code more
concise, and ensure that clk_unprepare is called when clk_enable fails.

A simplified version of the semantic patch that introduces calls to these
functions is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e;
@@

- clk_prepare(e);
- clk_enable(e);
+ clk_prepare_enable(e);

@@
expression e;
@@

- clk_disable(e);
- clk_unprepare(e);
+ clk_disable_unprepare(e);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/rtc-coh901331.c