From patchwork Mon Sep 3 16:25:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 1400471 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 04B743FC85 for ; Mon, 3 Sep 2012 16:29:46 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T8ZTj-0000Ft-D9; Mon, 03 Sep 2012 16:26:23 +0000 Received: from service87.mimecast.com ([91.220.42.44]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T8ZT5-00006A-UP for linux-arm-kernel@lists.infradead.org; Mon, 03 Sep 2012 16:25:48 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Mon, 03 Sep 2012 17:25:38 +0100 Received: from hornet.cambridge.arm.com ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Mon, 3 Sep 2012 17:27:44 +0100 From: Pawel Moll To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 01/11] input: ambakmi: Add missing clk_[un]prepare() calls Date: Mon, 3 Sep 2012 17:25:21 +0100 Message-Id: <1346689531-7212-2-git-send-email-pawel.moll@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346689531-7212-1-git-send-email-pawel.moll@arm.com> References: <1346689531-7212-1-git-send-email-pawel.moll@arm.com> X-OriginalArrivalTime: 03 Sep 2012 16:27:44.0217 (UTC) FILETIME=[0BD3DC90:01CD89F1] X-MC-Unique: 112090317253809501 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [91.220.42.44 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: arm@kernel.org, Pawel Moll X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Clocks must be prepared before enabling and unprepared after disabling. Without that clk_enable() fails with warning. Signed-off-by: Pawel Moll --- 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; + divisor = clk_get_rate(kmi->clk) / 8000000 - 1; writeb(divisor, KMICLKDIV); writeb(KMICR_EN, KMICR); @@ -93,6 +97,8 @@ static int amba_kmi_open(struct serio *io) clk_disable: clk_disable(kmi->clk); + clk_unprepare: + clk_unprepare(kmi->clk); out: return ret; } @@ -105,6 +111,7 @@ static void amba_kmi_close(struct serio *io) free_irq(kmi->irq, kmi); clk_disable(kmi->clk); + clk_unprepare(kmi->clk); } static int __devinit amba_kmi_probe(struct amba_device *dev,