From patchwork Tue Apr 26 05:34:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sahitya Tummala X-Patchwork-Id: 731452 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3Q5ZBg0017158 for ; Tue, 26 Apr 2011 05:35:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752934Ab1DZFfU (ORCPT ); Tue, 26 Apr 2011 01:35:20 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:22590 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752531Ab1DZFfU (ORCPT ); Tue, 26 Apr 2011 01:35:20 -0400 X-IronPort-AV: E=McAfee;i="5400,1158,6327"; a="87622082" Received: from pdmz-ns-mip.qualcomm.com (HELO mostmsg01.qualcomm.com) ([199.106.114.10]) by wolverine02.qualcomm.com with ESMTP/TLS/ADH-AES256-SHA; 25 Apr 2011 22:35:13 -0700 Received: from stummala-linux.in.qualcomm.com (pdmz-snip-v218.qualcomm.com [192.168.218.1]) by mostmsg01.qualcomm.com (Postfix) with ESMTPA id 89D0710004CA; Mon, 25 Apr 2011 22:34:53 -0700 (PDT) From: Sahitya Tummala To: davidb@codeaurora.org, dwalker@fifo99.com, bryanh@codeaurora.org Cc: linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org, san@google.com, Sahitya Tummala Subject: [PATCH 2/7] mmc: msm_sdcc: Handle error cases in probe Date: Tue, 26 Apr 2011 11:04:21 +0530 Message-Id: <1303796066-6784-2-git-send-email-stummala@codeaurora.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1303796066-6784-1-git-send-email-stummala@codeaurora.org> References: <1303796066-6784-1-git-send-email-stummala@codeaurora.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 26 Apr 2011 05:35:21 +0000 (UTC) Signed-off-by: Sahitya Tummala --- drivers/mmc/host/msm_sdcc.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c index d06539d..66ef5c3 100644 --- a/drivers/mmc/host/msm_sdcc.c +++ b/drivers/mmc/host/msm_sdcc.c @@ -1206,7 +1206,7 @@ msmsdcc_probe(struct platform_device *pdev) host->base = ioremap(memres->start, PAGE_SIZE); if (!host->base) { ret = -ENOMEM; - goto out; + goto host_free; } host->cmd_irqres = cmd_irqres; @@ -1221,13 +1221,15 @@ msmsdcc_probe(struct platform_device *pdev) /* * Setup DMA */ - msmsdcc_init_dma(host); + ret = msmsdcc_init_dma(host); + if (ret) + goto ioremap_free; /* Get our clocks */ host->pclk = clk_get(&pdev->dev, "sdc_pclk"); if (IS_ERR(host->pclk)) { ret = PTR_ERR(host->pclk); - goto host_free; + goto dma_free; } host->clk = clk_get(&pdev->dev, "sdc_clk"); @@ -1368,6 +1370,12 @@ msmsdcc_probe(struct platform_device *pdev) clk_put(host->clk); pclk_put: clk_put(host->pclk); +dma_free: + dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata), + host->dma.nc, host->dma.nc_busaddr); +ioremap_free: + tasklet_kill(&host->dma_tlet); + iounmap(host->base); host_free: mmc_free_host(mmc); out: