mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-12 03:26:26 +00:00
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>
This commit is contained in:
parent
bb8bdc77ef
commit
1c2215b7c6
1 changed files with 13 additions and 10 deletions
|
@ -1946,6 +1946,7 @@ int dw_mci_probe(struct dw_mci *host)
|
||||||
{
|
{
|
||||||
int width, i, ret = 0;
|
int width, i, ret = 0;
|
||||||
u32 fifo_size;
|
u32 fifo_size;
|
||||||
|
int init_slots = 0;
|
||||||
|
|
||||||
if (!host->pdata || !host->pdata->init) {
|
if (!host->pdata || !host->pdata->init) {
|
||||||
dev_err(host->dev,
|
dev_err(host->dev,
|
||||||
|
@ -2054,10 +2055,18 @@ int dw_mci_probe(struct dw_mci *host)
|
||||||
/* We need at least one slot to succeed */
|
/* We need at least one slot to succeed */
|
||||||
for (i = 0; i < host->num_slots; i++) {
|
for (i = 0; i < host->num_slots; i++) {
|
||||||
ret = dw_mci_init_slot(host, i);
|
ret = dw_mci_init_slot(host, i);
|
||||||
if (ret) {
|
if (ret)
|
||||||
ret = -ENODEV;
|
dev_dbg(host->dev, "slot %d init failed\n", i);
|
||||||
goto err_init_slot;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2092,12 +2101,6 @@ int dw_mci_probe(struct dw_mci *host)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_init_slot:
|
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);
|
free_irq(host->irq, host);
|
||||||
|
|
||||||
err_workqueue:
|
err_workqueue:
|
||||||
|
|
Loading…
Reference in a new issue