From patchwork Thu Sep 20 15:20:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11576 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7ED0E23E54 for ; Thu, 20 Sep 2012 15:22:34 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 2C5E1A1B0A8 for ; Thu, 20 Sep 2012 15:22:34 +0000 (UTC) Received: by ieje10 with SMTP id e10so3075494iej.11 for ; Thu, 20 Sep 2012 08:22:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=o4wuSqRChJXiyiu3qwV81RK8snUp6DLEHmx85+2rqcE=; b=lm777aLbaePHDkz6hhClE7LwpafJFBMaRVpr0uBY8U1cUraX0pyBgzDllzWKGNSPRA cavIgSkI++C48V+2Hy/r/s/sn2GdsQEpzuMOETr0pnCYOKq4bmRPx+f43ioR4xajBi17 FyE0UOv9swsHyBDsO9kyZ9G3e49Y1BX4YNX8jvA2NrMOX1cJ1uq4FD+5tOKb64hl8kkh Nz0EoTjibPyqqeKaxVUW7V40604ghFQV9QaFMCg0ZhAjWcGcvv0bYuU0mSivrhtB59hf QZ2sDM07AR+OSFu5QLIzTvl4TRUq9eXqmFUWzDzGvIP7m+caz6Ogu77gsABBAlyV7rzn 2QAg== Received: by 10.50.217.227 with SMTP id pb3mr2785151igc.28.1348154553539; Thu, 20 Sep 2012 08:22:33 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp81066igc; Thu, 20 Sep 2012 08:22:32 -0700 (PDT) Received: by 10.14.220.8 with SMTP id n8mr2301826eep.19.1348154551081; Thu, 20 Sep 2012 08:22:31 -0700 (PDT) Received: from eu1sys200aog104.obsmtp.com (eu1sys200aog104.obsmtp.com [207.126.144.117]) by mx.google.com with SMTP id 43si3945670eei.53.2012.09.20.08.22.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 08:22:31 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.117 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.117; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.117 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob104.postini.com ([207.126.147.11]) with SMTP ID DSNKUFs0rQcE9NPUzdV5BXYqTY3xx9k2f4JV@postini.com; Thu, 20 Sep 2012 15:22:30 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 52DAB5F; Thu, 20 Sep 2012 15:21:37 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 362EB4E; Thu, 20 Sep 2012 11:16:20 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 06DA124C080; Thu, 20 Sep 2012 17:21:58 +0200 (CEST) Received: from steludxu1397.lme.st.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 20 Sep 2012 17:22:05 +0200 From: Ulf Hansson To: Ben Dooks , Wolfram Sang , Cc: Linus Walleij , Alessandro Rubini , , Philippe Begnic , Ulf Hansson Subject: [PATCH] i2c-nomadik: Fixup clock handling Date: Thu, 20 Sep 2012 17:20:47 +0200 Message-ID: <1348154447-3815-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmmolypgVywro2VIs/+vBwF0XuHLtDIxUgZE/ElI7p7JNxpIDqJFhQPkQ7FIuSN6S9bn3dj From: Philippe Begnic Make sure to clk_prepare as well as clk_enable. Signed-off-by: Philippe Begnic Signed-off-by: Ulf Hansson --- drivers/i2c/busses/i2c-nomadik.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 1b898b6..3eeae52 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -642,7 +642,11 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap, pm_runtime_get_sync(&dev->adev->dev); - clk_enable(dev->clk); + status = clk_prepare_enable(dev->clk); + if (status) { + dev_err(&dev->adev->dev, "can't prepare_enable clock\n"); + goto out_clk; + } status = init_hw(dev); if (status) @@ -669,7 +673,8 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap, } out: - clk_disable(dev->clk); + clk_disable_unprepare(dev->clk); +out_clk: pm_runtime_put_sync(&dev->adev->dev); dev->busy = false;