From patchwork Fri Nov 11 10:50:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 5070 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 6559723E0F for ; Fri, 11 Nov 2011 10:51:30 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 3D2A6A183EA for ; Fri, 11 Nov 2011 10:51:30 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id n26so5533536faa.11 for ; Fri, 11 Nov 2011 02:51:30 -0800 (PST) Received: by 10.152.110.228 with SMTP id id4mr811506lab.19.1321008690011; Fri, 11 Nov 2011 02:51:30 -0800 (PST) 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.152.40.7 with SMTP id t7cs43145lak; Fri, 11 Nov 2011 02:51:29 -0800 (PST) Received: by 10.220.9.130 with SMTP id l2mr1344301vcl.261.1321008688020; Fri, 11 Nov 2011 02:51:28 -0800 (PST) Received: from TX2EHSOBE010.bigfish.com (tx2ehsobe005.messaging.microsoft.com. [65.55.88.15]) by mx.google.com with ESMTPS id u14si4742030anj.46.2011.11.11.02.51.27 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Nov 2011 02:51:27 -0800 (PST) Received-SPF: neutral (google.com: 65.55.88.15 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) client-ip=65.55.88.15; Authentication-Results: mx.google.com; spf=neutral (google.com: 65.55.88.15 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) smtp.mail=richard.zhao@linaro.org Received: from mail140-tx2-R.bigfish.com (10.9.14.250) by TX2EHSOBE010.bigfish.com (10.9.40.30) with Microsoft SMTP Server id 14.1.225.22; Fri, 11 Nov 2011 10:51:01 +0000 Received: from mail140-tx2 (localhost.localdomain [127.0.0.1]) by mail140-tx2-R.bigfish.com (Postfix) with ESMTP id CD9EC12F8169; Fri, 11 Nov 2011 10:51:15 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail140-tx2 (localhost.localdomain [127.0.0.1]) by mail140-tx2 (MessageSwitch) id 1321008675638343_6233; Fri, 11 Nov 2011 10:51:15 +0000 (UTC) Received: from TX2EHSMHS027.bigfish.com (unknown [10.9.14.250]) by mail140-tx2.bigfish.com (Postfix) with ESMTP id 937C81880052; Fri, 11 Nov 2011 10:51:15 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS027.bigfish.com (10.9.99.127) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 11 Nov 2011 10:51:00 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.339.2; Fri, 11 Nov 2011 04:51:25 -0600 Received: from b20223-02.ap.freescale.net (b20223-02-010192242124.ap.freescale.net [10.192.242.124]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id pABAoecV000610; Fri, 11 Nov 2011 04:51:22 -0600 (CST) From: Richard Zhao To: , , , , CC: , , , , , , , Richard Zhao Subject: [PATCH V3 11/14] serial: imx: add clk_prepare/clk_unprepare Date: Fri, 11 Nov 2011 18:50:34 +0800 Message-ID: <1321008637-19999-12-git-send-email-richard.zhao@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1321008637-19999-1-git-send-email-richard.zhao@linaro.org> References: <1321008637-19999-1-git-send-email-richard.zhao@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com Signed-off-by: Richard Zhao --- drivers/tty/serial/imx.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 163fc90..8f3709f 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1390,7 +1390,7 @@ static int serial_imx_probe(struct platform_device *pdev) ret = PTR_ERR(sport->clk); goto unmap; } - clk_enable(sport->clk); + clk_prepare_enable(sport->clk); sport->port.uartclk = clk_get_rate(sport->clk); @@ -1413,8 +1413,8 @@ deinit: if (pdata && pdata->exit) pdata->exit(pdev); clkput: + clk_disable_unprepare(sport->clk); clk_put(sport->clk); - clk_disable(sport->clk); unmap: iounmap(sport->port.membase); free: @@ -1434,11 +1434,10 @@ static int serial_imx_remove(struct platform_device *pdev) if (sport) { uart_remove_one_port(&imx_reg, &sport->port); + clk_disable_unprepare(sport->clk); clk_put(sport->clk); } - clk_disable(sport->clk); - if (pdata && pdata->exit) pdata->exit(pdev);