From patchwork Thu May 17 15:10:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 8758 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 844CF23E61 for ; Thu, 17 May 2012 14:58:55 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 54183A186E6 for ; Thu, 17 May 2012 14:58:55 +0000 (UTC) Received: by ggnf1 with SMTP id f1so2282055ggn.11 for ; Thu, 17 May 2012 07:58:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:x-gm-message-state; bh=fSV2CYiUvYVDwug5Idf73lXQ3HU373LVxRytaCRBCqM=; b=NroyEooXyl7W/Tjlvl++uyrsE8DNQSqerZc+TlVTpTldVhkmcvsa3usXNBVzeDIDJp CYsMpgsKwXjKFYcqVpWhzJjsMl7PbFguoh3iaU1UzSpJ07rf+xFJqjCW36NlXpx6L128 K/bVMRGbKEeid0q2KHdxKh2Dc9JqHVd9FzjweavWJgePThBkys4w0A9OQ59Xvn+4/38D mvdI8ax+iaKxEXCPcjbThzGr8zm92CxDD8XGzPxS47HRyqxFh7EGfLd0pOIqKwBPusPi KdeHPZYbFuftyMR18QaSQXYZhEaVTX89Q5JyP/PzuFw/mWUysYmbnoxoXZ3oo1Q/vEAi tp1w== Received: by 10.50.85.163 with SMTP id i3mr5681668igz.57.1337266734667; Thu, 17 May 2012 07:58:54 -0700 (PDT) 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.231.35.72 with SMTP id o8csp34112ibd; Thu, 17 May 2012 07:58:54 -0700 (PDT) Received: by 10.68.211.100 with SMTP id nb4mr28289574pbc.12.1337266733869; Thu, 17 May 2012 07:58:53 -0700 (PDT) Received: from mailout2.samsung.com (mailout2.samsung.com. [203.254.224.25]) by mx.google.com with ESMTP id sp3si5372628pbc.268.2012.05.17.07.58.53; Thu, 17 May 2012 07:58:53 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.25 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.25; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.25 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm1.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M46001A99M4CF30@mailout2.samsung.com> for patches@linaro.org; Thu, 17 May 2012 23:58:52 +0900 (KST) X-AuditID: cbfee61a-b7be0ae000001293-9d-4fb5122cb34c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 60.89.04755.C2215BF4; Thu, 17 May 2012 23:58:52 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M460077M9HVVD80@mmp1.samsung.com> for patches@linaro.org; Thu, 17 May 2012 23:58:52 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, cjb@laptop.org, grant.likely@secretlab.ca, rob.herring@calxeda.com, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, patches@linaro.org Subject: [PATCH v2 2/6] mmc: dw_mmc: allow probe to succeed even if one slot is initialized Date: Thu, 17 May 2012 20:40:07 +0530 Message-id: <1337267411-28226-3-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1337267411-28226-1-git-send-email-thomas.abraham@linaro.org> References: <1337267411-28226-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== X-TM-AS-MML: No X-Gm-Message-State: ALoCoQnruLTS+PwxPAFGmdI6ZNR22Ywfgq9dDTL3HEdYG9gBuZv8VXWirBD+WoA+wF1c8PCZC3UH Instead of aborting the probe in case a slot initialization fails, allow initialization of as many slots as possible. If there are atleast one instance of slot that is successfully initialized, allow the driver probe to succeed. Signed-off-by: Thomas Abraham --- drivers/mmc/host/dw_mmc.c | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 01d870a..5f38667 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1925,6 +1925,7 @@ int dw_mci_probe(struct dw_mci *host) { int width, i, ret = 0; u32 fifo_size; + int init_slots = 0; if (!host->pdata || !host->pdata->init) { dev_err(host->dev, @@ -2036,10 +2037,18 @@ int dw_mci_probe(struct dw_mci *host) /* We need at least one slot to succeed */ for (i = 0; i < host->num_slots; i++) { ret = dw_mci_init_slot(host, i); - if (ret) { - ret = -ENODEV; - goto err_init_slot; - } + if (ret) + dev_dbg(host->dev, "slot %d init failed\n", i); + else + init_slots++; + } + + if (init_slots) { + dev_info(host->dev, "%d slots initialized\n", init_slots); + } else { + dev_dbg(host->dev, "attempted to initialize %d slots, " + "but failed on all\n", host->num_slots); + goto err_init_slot; } /* @@ -2074,12 +2083,6 @@ int dw_mci_probe(struct dw_mci *host) return 0; err_init_slot: - /* De-init any initialized slots */ - while (i > 0) { - if (host->slot[i]) - dw_mci_cleanup_slot(host->slot[i], i); - i--; - } free_irq(host->irq, host); err_workqueue: