From patchwork Wed Aug 10 08:50:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh KUMAR X-Patchwork-Id: 1052182 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7A8pTbx026442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 10 Aug 2011 08:51:50 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Qr4Vd-00007n-4X; Wed, 10 Aug 2011 08:51:29 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Qr4Vc-000075-Ef for spi-devel-general@lists.sourceforge.net; Wed, 10 Aug 2011 08:51:28 +0000 X-ACL-Warn: Received: from eu1sys200aog102.obsmtp.com ([207.126.144.113]) by sog-mx-4.v43.ch3.sourceforge.com with smtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1Qr4Vb-0006Wi-1v for spi-devel-general@lists.sourceforge.net; Wed, 10 Aug 2011 08:51:28 +0000 Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob102.postini.com ([207.126.147.11]) with SMTP ID DSNKTkJGgbt5TsA+TgWFIApQtcw8CGxuvqnA@postini.com; Wed, 10 Aug 2011 08:51:26 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id D193D12B; Wed, 10 Aug 2011 08:51:09 +0000 (GMT) Received: from Webmail-ap.st.com (eapex1hubcas1.st.com [10.80.176.8]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id AFB40C1A; Wed, 10 Aug 2011 08:51:09 +0000 (GMT) Received: from localhost (10.199.88.156) by Webmail-ap.st.com (10.80.176.7) with Microsoft SMTP Server (TLS) id 8.2.234.1; Wed, 10 Aug 2011 16:51:09 +0800 From: Viresh Kumar To: Subject: [PATCH V2 5/6] spi/spi-pl022: Call pl022_dma_remove(pl022) only if enable_dma is true Date: Wed, 10 Aug 2011 14:20:58 +0530 Message-ID: <3b94e4c3ce4689a41f4293863cbd9d8e164cd14c.1312965742.git.viresh.kumar@st.com> X-Mailer: git-send-email 1.7.2.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.3 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.3 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Qr4Vb-0006Wi-1v Cc: pratyush.anand@st.com, viresh.kumar@st.com, rajeev-dlh.kumar@st.com, bhavna.yadav@st.com, bhupesh.sharma@st.com, armando.visconti@st.com, linus.walleij@linaro.org, vipin.kumar@st.com, shiraz.hashim@st.com, amit.virdi@st.com, vipulkumar.samar@st.com, deepak.sikri@st.com, spi-devel-general@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 10 Aug 2011 08:51:50 +0000 (UTC) pl022_dma_remove() should be called only if enable_dma is true. There is no point calling it when pl022_dma_probe() is not called, which again depends on enable_dma. Signed-off-by: Viresh Kumar Tested-by: Linus Walleij --- drivers/spi/spi-pl022.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index d1bcc79..01e84e3 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2238,7 +2238,9 @@ err_spi_register: err_start_queue: err_init_queue: destroy_queue(pl022); - pl022_dma_remove(pl022); + if (platform_info->enable_dma) + pl022_dma_remove(pl022); + free_irq(adev->irq[0], pl022); pm_runtime_disable(&adev->dev); err_no_irq: @@ -2266,7 +2268,9 @@ pl022_remove(struct amba_device *adev) if (destroy_queue(pl022) != 0) dev_err(&adev->dev, "queue remove failed\n"); load_ssp_default_config(pl022); - pl022_dma_remove(pl022); + if (pl022->master_info->enable_dma) + pl022_dma_remove(pl022); + free_irq(adev->irq[0], pl022); clk_disable(pl022->clk); clk_put(pl022->clk);