[PATCH 01/11] input: ambakmi: Add missing clk_[un]prepare() calls

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Tue Sep 4 09:37:44 EDT 2012


Pawel,

Le Mon,  3 Sep 2012 17:25:21 +0100,
Pawel Moll <pawel.moll at arm.com> a écrit :

> Clocks must be prepared before enabling and unprepared
> after disabling. Without that clk_enable() fails with
> warning.
> 
> Signed-off-by: Pawel Moll <pawel.moll at arm.com>
> ---
>  drivers/input/serio/ambakmi.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
> index 2ffd110..ab2d25b 100644
> --- a/drivers/input/serio/ambakmi.c
> +++ b/drivers/input/serio/ambakmi.c
> @@ -72,10 +72,14 @@ static int amba_kmi_open(struct serio *io)
>  	unsigned int divisor;
>  	int ret;
>  
> -	ret = clk_enable(kmi->clk);
> +	ret = clk_prepare(kmi->clk);
>  	if (ret)
>  		goto out;
>  
> +	ret = clk_enable(kmi->clk);
> +	if (ret)
> +		goto clk_unprepare;
> +

What about using clk_prepare_enable() here?

>  	free_irq(kmi->irq, kmi);
>  	clk_disable(kmi->clk);
> +	clk_unprepare(kmi->clk);

And clk_disable_unprepare() here?

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com



More information about the linux-arm-kernel mailing list