From patchwork Tue Jun 12 17:19:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9233 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 9740723E56 for ; Tue, 12 Jun 2012 17:19:29 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5E9FAA18300 for ; Tue, 12 Jun 2012 17:19:29 +0000 (UTC) Received: by yenq6 with SMTP id q6so3978462yen.11 for ; Tue, 12 Jun 2012 10:19:28 -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=j6jZjfxdmHAWbE7YfWpuM+vygnaXazrnD1+rj3HzBQA=; b=Hgy693CR6wIObzYGW7NE8JpKFdiiGsBirFP+jmY5GtugwfOSfwBC1X6OwJdnpEtJWj ke7f8LXyD4OXUMxfosQKwKJJJT9gDypPQRT8KxemZsmZA4vle90DMv6IqVZronRbrHFh HKr29jQuZB7FxpII4WmPct4CTCMTSp45ny7+u6+P5kYnqAP9JxRMv8tU3m1NM1NnmDFI LOkGKnZ7RGt7iiKR6is3zyhHIGGe6w4pQtlezS+ZZXEYs2wDucbCtBkLKS3YH/EYa81N jVIidAf6IcVnfSVPJOS+8QFCeTi+Il6YyWGf6bnghXpKV9x9kq8kIugnBs4t3gU+SmgJ 5OTA== Received: by 10.50.193.196 with SMTP id hq4mr8900344igc.57.1339521568577; Tue, 12 Jun 2012 10:19:28 -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 v20csp178895ibb; Tue, 12 Jun 2012 10:19:27 -0700 (PDT) Received: by 10.14.29.4 with SMTP id h4mr6702977eea.178.1339521567294; Tue, 12 Jun 2012 10:19:27 -0700 (PDT) Received: from eu1sys200aog117.obsmtp.com (eu1sys200aog117.obsmtp.com. [207.126.144.143]) by mx.google.com with SMTP id o6si9510806eeb.74.2012.06.12.10.19.22 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jun 2012 10:19:27 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.143 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.143; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.143 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 eu1sys200aob117.postini.com ([207.126.147.11]) with SMTP ID DSNKT9d6GGWgbD/F5o7ydLlSG/fdX8XNB+bZ@postini.com; Tue, 12 Jun 2012 17:19:26 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 AB8D158; Tue, 12 Jun 2012 17:18:51 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 536734A; Tue, 12 Jun 2012 14:30:51 +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 AA57524C07C; Tue, 12 Jun 2012 19:19:02 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 12 Jun 2012 19:19:11 +0200 From: Linus Walleij To: Wim Van Sebroeck , Cc: , Linus Walleij Subject: [PATCH] watchdog: coh901327_wdt: use clk_prepare/unprepare Date: Tue, 12 Jun 2012 19:19:01 +0200 Message-ID: <1339521541-30183-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: ALoCoQm46lmrrMrVUx3kX7nv9OSVsM6ulZWUFOUtp0X7a76V9NI00m0Fv2hq8HHK8yUb2UV6THdq From: Linus Walleij Make sure we prepare/unprepare the COH901327 watchdog timer as is required by the clk API especially if you use common clock. Signed-off-by: Linus Walleij --- drivers/watchdog/coh901327_wdt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c index 6876430..cb5da5c 100644 --- a/drivers/watchdog/coh901327_wdt.c +++ b/drivers/watchdog/coh901327_wdt.c @@ -263,6 +263,7 @@ static int __exit coh901327_remove(struct platform_device *pdev) watchdog_unregister_device(&coh901327_wdt); coh901327_disable(); free_irq(irq, pdev); + clk_unprepare(clk); clk_put(clk); iounmap(virtbase); release_mem_region(phybase, physize); @@ -300,9 +301,9 @@ static int __init coh901327_probe(struct platform_device *pdev) dev_err(&pdev->dev, "could not get clock\n"); goto out_no_clk; } - ret = clk_enable(clk); + ret = clk_prepare_enable(clk); if (ret) { - dev_err(&pdev->dev, "could not enable clock\n"); + dev_err(&pdev->dev, "could not prepare and enable clock\n"); goto out_no_clk_enable; } @@ -369,7 +370,7 @@ static int __init coh901327_probe(struct platform_device *pdev) out_no_wdog: free_irq(irq, pdev); out_no_irq: - clk_disable(clk); + clk_disable_unprepare(clk); out_no_clk_enable: clk_put(clk); out_no_clk: