diff options
author | Thomas Abraham <thomas.abraham@linaro.org> | 2012-09-17 14:16:37 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-10-03 10:05:15 -0400 |
commit | 1c2215b7c6f20a65877431a5ebb4f9a789df3811 (patch) | |
tree | 057f35ba530ca8cd4ad564c743bfa2b50b4a55de | |
parent | bb8bdc77efdecc868d522691487d261ac32d3237 (diff) |
mmc: dw_mmc: allow probe to succeed even if one slot is initialized
Instead of aborting the probe when a slot initialization fails, allow
initialization of as many slots as possible. If there is at least one
instance of a slot that is successfully initialized, allow the driver
probe to succeed.
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | 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 a18e73c7305e..227c42ef18c5 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
@@ -1946,6 +1946,7 @@ int dw_mci_probe(struct dw_mci *host) | |||
1946 | { | 1946 | { |
1947 | int width, i, ret = 0; | 1947 | int width, i, ret = 0; |
1948 | u32 fifo_size; | 1948 | u32 fifo_size; |
1949 | int init_slots = 0; | ||
1949 | 1950 | ||
1950 | if (!host->pdata || !host->pdata->init) { | 1951 | if (!host->pdata || !host->pdata->init) { |
1951 | dev_err(host->dev, | 1952 | dev_err(host->dev, |
@@ -2054,10 +2055,18 @@ int dw_mci_probe(struct dw_mci *host) | |||
2054 | /* We need at least one slot to succeed */ | 2055 | /* We need at least one slot to succeed */ |
2055 | for (i = 0; i < host->num_slots; i++) { | 2056 | for (i = 0; i < host->num_slots; i++) { |
2056 | ret = dw_mci_init_slot(host, i); | 2057 | ret = dw_mci_init_slot(host, i); |
2057 | if (ret) { | 2058 | if (ret) |
2058 | ret = -ENODEV; | 2059 | dev_dbg(host->dev, "slot %d init failed\n", i); |
2059 | goto err_init_slot; | 2060 | else |
2060 | } | 2061 | init_slots++; |
2062 | } | ||
2063 | |||
2064 | if (init_slots) { | ||
2065 | dev_info(host->dev, "%d slots initialized\n", init_slots); | ||
2066 | } else { | ||
2067 | dev_dbg(host->dev, "attempted to initialize %d slots, " | ||
2068 | "but failed on all\n", host->num_slots); | ||
2069 | goto err_init_slot; | ||
2061 | } | 2070 | } |
2062 | 2071 | ||
2063 | /* | 2072 | /* |
@@ -2092,12 +2101,6 @@ int dw_mci_probe(struct dw_mci *host) | |||
2092 | return 0; | 2101 | return 0; |
2093 | 2102 | ||
2094 | err_init_slot: | 2103 | err_init_slot: |
2095 | /* De-init any initialized slots */ | ||
2096 | while (i > 0) { | ||
2097 | if (host->slot[i]) | ||
2098 | dw_mci_cleanup_slot(host->slot[i], i); | ||
2099 | i--; | ||
2100 | } | ||
2101 | free_irq(host->irq, host); | 2104 | free_irq(host->irq, host); |
2102 | 2105 | ||
2103 | err_workqueue: | 2106 | err_workqueue: |