]> 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>
Tue, 25 Sep 2012 08:46:43 +0000 (18:46 +1000)
commitca0f9b74e75fd128b0f11af2cf2e3a7a50583145
treee53d0555cbcdd252059d335af9c19414fb4f8521
parenta26c1f475999108efc23396d36a2a5893ae9b3ff
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