[PATCH 01/11] input: ambakmi: Add missing clk_[un]prepare() calls
From: Thomas Petazzoni <hidden>
Date: 2012-09-04 13:37:44
Pawel, Le Mon, 3 Sep 2012 17:25:21 +0100, Pawel Moll [off-list ref] a ?crit :
quoted hunk ↗ jump to hunk
Clocks must be prepared before enabling and unprepared after disabling. Without that clk_enable() fails with warning. Signed-off-by: Pawel Moll <redacted> --- 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