Skip to contentSkip to conversation

mmc: dw_mmc: Pass back errors from mmc_of_parse()

PATCH Applied Doug Anderson 3 participants 3 messages Aug 25, 2014 – Aug 29, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: dw_mmc: Pass back errors from mmc_of_parse()

It's possible that mmc_of_parse() could return errors (possibly in some future version it might return -EPROBE_DEFER even). Let's pass those errors back.

---
 drivers/mmc/host/dw_mmc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/mmc/host/dw_mmc.c +6 -4
index 7f227e9..9ef4df0 100644
@@ -2131,7 +2131,9 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 	if (host->pdata->caps2)
 		mmc->caps2 = host->pdata->caps2;
 
-	mmc_of_parse(mmc);
+	ret = mmc_of_parse(mmc);
+	if (ret)
+		goto err_host_allocated;
 
 	if (host->pdata->blk_settings) {
 		mmc->max_segs = host->pdata->blk_settings->max_segs;
@@ -2163,7 +2165,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 
 	ret = mmc_add_host(mmc);
 	if (ret)
-		goto err_setup_bus;
+		goto err_host_allocated;
 
 #if defined(CONFIG_DEBUG_FS)
 	dw_mci_init_debugfs(slot);
@@ -2174,9 +2176,9 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 
 	return 0;
 
-err_setup_bus:
+err_host_allocated:
 	mmc_free_host(mmc);
-	return -EINVAL;
+	return ret;
 }
 
 static void dw_mci_cleanup_slot(struct dw_mci_slot *slot, unsigned int id)
Signature · 1 line
2.1.0.rc2.206.gedb03e5
maintainer Acked-by on v1 1/1
#1 lore raw

Looks good to me.

Best Regards,
Jaehoon Chung

Quoted 46 lines · Doug Anderson

It's possible that mmc_of_parse() could return errors (possibly in some future version it might return -EPROBE_DEFER even). Let's pass those errors back.

---
 drivers/mmc/host/dw_mmc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/mmc/host/dw_mmc.c +6 -4
index 7f227e9..9ef4df0 100644
@@ -2131,7 +2131,9 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 	if (host->pdata->caps2)
 		mmc->caps2 = host->pdata->caps2;
 
-	mmc_of_parse(mmc);
+	ret = mmc_of_parse(mmc);
+	if (ret)
+		goto err_host_allocated;
 
 	if (host->pdata->blk_settings) {
 		mmc->max_segs = host->pdata->blk_settings->max_segs;
@@ -2163,7 +2165,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 
 	ret = mmc_add_host(mmc);
 	if (ret)
-		goto err_setup_bus;
+		goto err_host_allocated;
 
 #if defined(CONFIG_DEBUG_FS)
 	dw_mci_init_debugfs(slot);
@@ -2174,9 +2176,9 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 
 	return 0;
 
-err_setup_bus:
+err_host_allocated:
 	mmc_free_host(mmc);
-	return -EINVAL;
+	return ret;
 }
 
 static void dw_mci_cleanup_slot(struct dw_mci_slot *slot, unsigned int id)
Applied
#2 lore raw
In reply to Doug Anderson
Quoted 5 lines · Doug Anderson

It's possible that mmc_of_parse() could return errors (possibly in some future version it might return -EPROBE_DEFER even). Let's pass those errors back.

Thanks! Applied for next.

I needed to resolve to simple conflict, but you still might want to verify that the end result is what you expected.

Kind regards
Uffe

Quoted 43 lines
---
 drivers/mmc/host/dw_mmc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/mmc/host/dw_mmc.c +6 -5
index 7f227e9..9ef4df0 100644
@@ -2131,7 +2131,9 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
        if (host->pdata->caps2)
                mmc->caps2 = host->pdata->caps2;
 
-       mmc_of_parse(mmc);
+       ret = mmc_of_parse(mmc);
+       if (ret)
+               goto err_host_allocated;
 
        if (host->pdata->blk_settings) {
                mmc->max_segs = host->pdata->blk_settings->max_segs;
@@ -2163,7 +2165,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 
        ret = mmc_add_host(mmc);
        if (ret)
-               goto err_setup_bus;
+               goto err_host_allocated;
 
 #if defined(CONFIG_DEBUG_FS)
        dw_mci_init_debugfs(slot);
@@ -2174,9 +2176,9 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 
        return 0;
 
-err_setup_bus:
+err_host_allocated:
        mmc_free_host(mmc);
-       return -EINVAL;
+       return ret;
 }
 
 static void dw_mci_cleanup_slot(struct dw_mci_slot *slot, unsigned int id)
--

2.1.0.rc2.206.gedb03e5