drivers/iio/adc/at91_adc.c: use clk_prepare_enable and clk_disable_unprepare
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 26 Aug 2012 16:00:00 +0000 (17:00 +0100)
committerJonathan Cameron <jic23@kernel.org>
Mon, 3 Sep 2012 19:26:42 +0000 (20:26 +0100)
commit00062a9c2e772345388cd352695790f00a95b934
treea88b88efcec84f2f6b4089b8eac37dab0015de6a
parentf5ed9c35bd2af6d9d171290d3dc45004f4f79bcf
drivers/iio/adc/at91_adc.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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/at91_adc.c