drivers/staging/iio/adc/spear_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:41 +0000 (20:26 +0100)
commitf5ed9c35bd2af6d9d171290d3dc45004f4f79bcf
tree58bb6d3362bbdc981ad9dcc917247d8eaf6c2f2e
parent91b4171f4e7e2d49aee54259b50e703e09bcff20
drivers/staging/iio/adc/spear_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>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/adc/spear_adc.c