devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Abraham <thomas.abraham@linaro.org>
To: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org
Cc: cjb@laptop.org, grant.likely@secretlab.ca,
	rob.herring@calxeda.com, linux-samsung-soc@vger.kernel.org,
	kgene.kim@samsung.com, girish.shivananjappa@linaro.org,
	jh80.chung@samsung.com, tgih.jun@samsung.com, patches@linaro.org
Subject: [PATCH v4 3/9] mmc: dw_mmc: allow probe to succeed even if one slot is initialized
Date: Sun, 26 Aug 2012 17:22:01 +0530	[thread overview]
Message-ID: <1345981927-26359-4-git-send-email-thomas.abraham@linaro.org> (raw)
In-Reply-To: <1345981927-26359-1-git-send-email-thomas.abraham@linaro.org>

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 <thomas.abraham@linaro.org>
---
 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 948a7ac..cd58063 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1939,6 +1939,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,
@@ -2047,10 +2048,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;
 	}
 
 	/*
@@ -2085,12 +2094,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:
-- 
1.6.6.rc2

  parent reply	other threads:[~2012-08-26 11:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-26 11:51 [PATCH v4 0/9] mmc: dw_mmc: add support for device tree based instantiation Thomas Abraham
2012-08-26 11:51 ` [PATCH v4 1/9] mmc: dw_mmc: convert copy of struct device in struct dw_mci to a reference Thomas Abraham
2012-08-26 11:52 ` [PATCH v4 2/9] mmc: dw_mmc: Use devm_* functions in dw_mmc platform driver Thomas Abraham
2012-08-26 11:52 ` Thomas Abraham [this message]
2012-08-26 11:52 ` [PATCH v4 4/9] mmc: dw_mmc: lookup for optional biu and ciu clocks Thomas Abraham
2012-08-28 10:43   ` Seungwon Jeon
2012-08-28 11:23     ` Thomas Abraham
2012-08-26 11:52 ` [PATCH v4 5/9] mmc: dw_mmc: add quirk to indicate missing write protect line Thomas Abraham
2012-08-26 11:52 ` [PATCH v4 6/9] mmc: dw_mmc: add device tree support Thomas Abraham
2012-08-26 11:52 ` [PATCH v4 7/9] mmc: dw_mmc: prepare functions in dw_mmc-pltfm for reuse Thomas Abraham
2012-08-26 11:52 ` [PATCH v4 8/9] mmc: dw_mmc: add support for implementation specific callbacks Thomas Abraham
2012-08-26 11:52 ` [PATCH v4 9/9] mmc: dw_mmc: add support for exynos specific implementation of dw-mshc Thomas Abraham
2012-08-27  8:58   ` Jaehoon Chung
2012-08-28  4:48     ` Thomas Abraham
2012-08-28  4:55       ` Jaehoon Chung
2012-08-28  5:10         ` Thomas Abraham
2012-08-28  5:10           ` Thomas Abraham
2012-08-28  5:16             ` Jaehoon Chung
2012-08-28  5:20               ` Thomas Abraham
2012-08-28  7:06   ` Seungwon Jeon
2012-08-28  7:42     ` Thomas Abraham
2012-08-28 10:43       ` Seungwon Jeon
2012-08-28 11:35         ` Thomas Abraham
2012-08-27  9:31 ` [PATCH v4 0/9] mmc: dw_mmc: add support for device tree based instantiation Will Newton
2012-08-28  4:52   ` Thomas Abraham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345981927-26359-4-git-send-email-thomas.abraham@linaro.org \
    --to=thomas.abraham@linaro.org \
    --cc=cjb@laptop.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=girish.shivananjappa@linaro.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jh80.chung@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rob.herring@calxeda.com \
    --cc=tgih.jun@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).