From patchwork Tue Jun 12 17:33:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9234 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 183C823E0C for ; Tue, 12 Jun 2012 17:33:43 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id D23BFA18322 for ; Tue, 12 Jun 2012 17:33:42 +0000 (UTC) Received: by yhpp61 with SMTP id p61so4023917yhp.11 for ; Tue, 12 Jun 2012 10:33:42 -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=Ploi0zoef4YISyWZdIWtkO5A85W00+M6bg58Bg5bvwA=; b=CjQQBUn1pnjpRQJqguMO2iwf63fwScAapwDQ9Im2woKJYnr1K0EGv8Ar9NVvLhW6ip h5M9I+lFRkAa4HmYno/YUYvTB8/lSIX/mDf3eTRa5n343mQnfuHI/vl0Uesxvm/bROMa YMzLBXblTg/IyYqnv4EJ7n8g49x8Nmva2KZGY8FU5JVS2nEKDA5t7yBu/1Yc8GlhouB5 xRYJ0oID327BdBm9ILMqyX4pQOf+77BoWxfLy5VxSePdIhg0qXjQmVil8Z4uY6YEDimV Q0OykextrKazrEi1MYybxzs8AEiTsYgK2sXuzXEx2/sUYa7hDewJbjn+TeJCxAwFIyrY VqmA== Received: by 10.50.203.39 with SMTP id kn7mr8974380igc.53.1339522422190; Tue, 12 Jun 2012 10:33:42 -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.231.24.148 with SMTP id v20csp179641ibb; Tue, 12 Jun 2012 10:33:41 -0700 (PDT) Received: by 10.14.95.207 with SMTP id p55mr1139071eef.40.1339522420734; Tue, 12 Jun 2012 10:33:40 -0700 (PDT) Received: from eu1sys200aog103.obsmtp.com (eu1sys200aog103.obsmtp.com. [207.126.144.115]) by mx.google.com with SMTP id a11si9522197een.109.2012.06.12.10.33.37 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jun 2012 10:33:40 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.115; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob103.postini.com ([207.126.147.11]) with SMTP ID DSNKT9d9cLs8y/Fw7050lc1HBqFeNpKs7Giw@postini.com; Tue, 12 Jun 2012 17:33:40 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 DA44E58; Tue, 12 Jun 2012 17:33:12 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 5542A4A; Tue, 12 Jun 2012 14:45:12 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 42892A8072; Tue, 12 Jun 2012 19:33:26 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 12 Jun 2012 19:33:32 +0200 From: Linus Walleij To: Ben Dooks , Wolfram Sang , Cc: Linus Walleij Subject: [PATCH 1/2] i2c: stu300: use clk_prepare/unprepare Date: Tue, 12 Jun 2012 19:33:30 +0200 Message-ID: <1339522410-570-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.9.2 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkGx0Jsoo+28U/+gxITMDjVcJDWCPVOE15fIzw5fajDO4LVyV6oHrKeRWjnALJOjVBW8PEn From: Linus Walleij Make sure we prepare/unprepare the clock for the ST U300 I2C driver as is required by the clk API especially if you use common clock. Signed-off-by: Linus Walleij --- drivers/i2c/busses/i2c-stu300.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c index 4d44af1..79b7851 100644 --- a/drivers/i2c/busses/i2c-stu300.c +++ b/drivers/i2c/busses/i2c-stu300.c @@ -924,7 +924,7 @@ stu300_probe(struct platform_device *pdev) dev->speed = scl_frequency; - clk_enable(dev->clk); + clk_prepare_enable(dev->clk); ret = stu300_init_hw(dev); clk_disable(dev->clk); @@ -960,6 +960,7 @@ stu300_probe(struct platform_device *pdev) err_add_adapter: err_init_hw: + clk_unprepare(dev->clk); free_irq(dev->irq, dev); err_no_irq: iounmap(dev->virtbase); @@ -1016,6 +1017,7 @@ stu300_remove(struct platform_device *pdev) free_irq(dev->irq, dev); iounmap(dev->virtbase); release_mem_region(dev->phybase, dev->physize); + clk_unprepare(dev->clk); clk_put(dev->clk); platform_set_drvdata(pdev, NULL); kfree(dev);