From patchwork Tue Jan 10 07:01:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 6133 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 8ADC423F84 for ; Tue, 10 Jan 2012 07:02:10 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 69028A184E2 for ; Tue, 10 Jan 2012 07:02:10 +0000 (UTC) Received: by bkbzu5 with SMTP id zu5so295178bkb.11 for ; Mon, 09 Jan 2012 23:02:10 -0800 (PST) Received: by 10.204.149.130 with SMTP id t2mr3725391bkv.9.1326178930053; Mon, 09 Jan 2012 23:02:10 -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.205.82.144 with SMTP id ac16cs74699bkc; Mon, 9 Jan 2012 23:02:09 -0800 (PST) Received: by 10.68.191.70 with SMTP id gw6mr48476481pbc.85.1326178927429; Mon, 09 Jan 2012 23:02:07 -0800 (PST) Received: from TX2EHSOBE007.bigfish.com (tx2ehsobe004.messaging.microsoft.com. [65.55.88.14]) by mx.google.com with ESMTPS id t7si93292465pbv.157.2012.01.09.23.02.06 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jan 2012 23:02:07 -0800 (PST) Received-SPF: neutral (google.com: 65.55.88.14 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) client-ip=65.55.88.14; Authentication-Results: mx.google.com; spf=neutral (google.com: 65.55.88.14 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) smtp.mail=richard.zhao@linaro.org Received: from mail61-tx2-R.bigfish.com (10.9.14.238) by TX2EHSOBE007.bigfish.com (10.9.40.27) with Microsoft SMTP Server id 14.1.225.23; Tue, 10 Jan 2012 07:02:05 +0000 Received: from mail61-tx2 (localhost [127.0.0.1]) by mail61-tx2-R.bigfish.com (Postfix) with ESMTP id 41F545802D4; Tue, 10 Jan 2012 07:02:05 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dhc1ahc1bh87h2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail61-tx2 (localhost.localdomain [127.0.0.1]) by mail61-tx2 (MessageSwitch) id 1326178924756773_23715; Tue, 10 Jan 2012 07:02:04 +0000 (UTC) Received: from TX2EHSMHS023.bigfish.com (unknown [10.9.14.253]) by mail61-tx2.bigfish.com (Postfix) with ESMTP id A5BF26400D1; Tue, 10 Jan 2012 07:02:04 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS023.bigfish.com (10.9.99.123) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 10 Jan 2012 07:02:04 +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.355.3; Tue, 10 Jan 2012 01:02:03 -0600 Received: from b20223-02.ap.freescale.net (b20223-02.ap.freescale.net [10.192.242.124]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id q0A71qKl000113; Tue, 10 Jan 2012 01:02:01 -0600 (CST) From: Richard Zhao To: , CC: , , , , , , Richard Zhao Subject: [PATCH 4/6] dma/imx-sdma: move clk_enable out of sdma_request_channel Date: Tue, 10 Jan 2012 15:01:48 +0800 Message-ID: <1326178910-14044-4-git-send-email-richard.zhao@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1326178910-14044-1-git-send-email-richard.zhao@linaro.org> References: <1326178910-14044-1-git-send-email-richard.zhao@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com It makes clk_enable/disable pair more readable, and fix one bug: sdma_init calls sdma_request_channel, but seems don't know sdma_request_channel enabled the clok. Signed-off-by: Richard Zhao Acked-by: Shawn Guo --- drivers/dma/imx-sdma.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index b40f630..015d93f 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -802,8 +802,6 @@ static int sdma_request_channel(struct sdma_channel *sdmac) sdma->channel_control[channel].base_bd_ptr = sdmac->bd_phys; sdma->channel_control[channel].current_bd_ptr = sdmac->bd_phys; - clk_enable(sdma->clk); - sdma_set_channel_priority(sdmac, MXC_SDMA_DEFAULT_PRIORITY); init_completion(&sdmac->done); @@ -875,6 +873,9 @@ static int sdma_alloc_chan_resources(struct dma_chan *chan) sdmac->peripheral_type = data->peripheral_type; sdmac->event_id0 = data->dma_request; + + clk_enable(sdmac->sdma->clk); + ret = sdma_request_channel(sdmac); if (ret) return ret;