From patchwork Mon Apr 4 06:07:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 684551 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 p3468trt009251 for ; Mon, 4 Apr 2011 06:08:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752498Ab1DDGIv (ORCPT ); Mon, 4 Apr 2011 02:08:51 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:60677 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751654Ab1DDGIu (ORCPT ); Mon, 4 Apr 2011 02:08:50 -0400 Received: from epmmp2 (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LJ400F7J6E4QPF0@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Mon, 04 Apr 2011 15:08:28 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp2.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LJ400IES6E4WX@mmp2.samsung.com> for linux-mmc@vger.kernel.org; Mon, 04 Apr 2011 15:08:28 +0900 (KST) Received: from [165.213.219.108] ([165.213.219.108]) by TNRNDGASPAPP1.tn.corp.samsungelectronics.net with Microsoft SMTPSVC(6.0.3790.4675); Mon, 04 Apr 2011 15:08:27 +0900 Date: Mon, 04 Apr 2011 15:07:02 +0900 From: Jaehoon Chung Subject: [PATCH v2] mmc: sdhci: add error checking for mmc_add_host To: "linux-mmc@vger.kernel.org" Cc: Chris Ball , Wolfram Sang , Kyungmin Park Message-id: <4D996006.9030402@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7BIT User-Agent: Thunderbird 2.0.0.24 (X11/20100317) X-OriginalArrivalTime: 04 Apr 2011 06:08:27.0901 (UTC) FILETIME=[B6F57AD0:01CBF28E] 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]); Mon, 04 Apr 2011 06:08:55 +0000 (UTC) Sometimes we can't add the device,but we didn't check any error status. Need to check error status for mmc_add_host. Signed-off-by: Jaehoon Chung Signed-off-by: kyungmin Park --- drivers/mmc/host/sdhci.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 9e15f41..7070716 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2025,7 +2025,9 @@ int sdhci_add_host(struct sdhci_host *host) mmiowb(); - mmc_add_host(mmc); + ret = mmc_add_host(mmc); + if (unlikely(ret)) + goto err_free_mmc; printk(KERN_INFO "%s: SDHCI controller on %s [%s] using %s\n", mmc_hostname(mmc), host->hw_name, dev_name(mmc_dev(mmc)), @@ -2036,11 +2038,19 @@ int sdhci_add_host(struct sdhci_host *host) return 0; +err_free_mmc: + mmc_free_host(host); + #ifdef SDHCI_USE_LEDS_CLASS reset: +#endif sdhci_reset(host, SDHCI_RESET_ALL); free_irq(host->irq, host); -#endif + if (host->vmmc) { + regulator_disable(host->vmmc); + regulator_put(host->vmmc); + } + untasklet: tasklet_kill(&host->card_tasklet); tasklet_kill(&host->finish_tasklet);