]> git.kernelconcepts.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>
Thu, 13 Sep 2012 01:01:20 +0000 (11:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 13 Sep 2012 07:28:13 +0000 (17:28 +1000)
commit9c92ec6e0a341287645fcfadfbd5e0daf0cf3754
tree8074133bd121b0cd07b2fc5e0ebcbc9ce5d5158b
parent00c991f986a69149b092957f323262741166bccb
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