Skip to contentSkip to conversation

mmc: dw_mmc: replace the bus_hz checking point

PATCH In review Jaehoon Chung 2 participants 3 messages Feb 3, 2014 – Feb 7, 2014

Subsystems (2)
lore
Share & tools
lore

Jaehoon Chung

author maintainer
#0 lore raw

PATCH v3 3/8 mmc: dw_mmc: replace the bus_hz checking point

It's right that check immediately whether host->bus_hz is assigned or not.

---
Changelog V3:
- Maintained original place for the drv_data->setup_clock
Changelog V2:
- When drv_data->setup_clock is present, set to bus_hz with it.

 drivers/mmc/host/dw_mmc.c |   22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)
drivers/mmc/host/dw_mmc.c +10 -12
index 8193e21..e7357b8 100644
@@ -2427,12 +2427,19 @@ int dw_mci_probe(struct dw_mci *host)
 			ret = clk_set_rate(host->ciu_clk, host->pdata->bus_hz);
 			if (ret)
 				dev_warn(host->dev,
-					 "Unable to set bus rate to %ul\n",
+					 "Unable to set bus rate to %uHz\n",
 					 host->pdata->bus_hz);
 		}
 		host->bus_hz = clk_get_rate(host->ciu_clk);
 	}
 
+	if (!host->bus_hz) {
+		dev_err(host->dev,
+			"Platform data must supply bus speed\n");
+		ret = -ENODEV;
+		goto err_clk_ciu;
+	}
+
 	if (drv_data && drv_data->init) {
 		ret = drv_data->init(host);
 		if (ret) {
@@ -2445,8 +2452,8 @@ int dw_mci_probe(struct dw_mci *host)
 	if (drv_data && drv_data->setup_clock) {
 		ret = drv_data->setup_clock(host);
 		if (ret) {
-			dev_err(host->dev,
-				"implementation specific clock setup failed\n");
+			dev_err(host->dev, "implementation specific "
+				"clock setup failed\n");
 			goto err_clk_ciu;
 		}
 	}
@@ -2469,13 +2476,6 @@ int dw_mci_probe(struct dw_mci *host)
 		}
 	}
 
-	if (!host->bus_hz) {
-		dev_err(host->dev,
-			"Platform data must supply bus speed\n");
-		ret = -ENODEV;
-		goto err_regulator;
-	}
-
 	host->quirks = host->pdata->quirks;
 
 	spin_lock_init(&host->lock);
@@ -2619,8 +2619,6 @@ err_workqueue:
 err_dmaunmap:
 	if (host->use_dma && host->dma_ops->exit)
 		host->dma_ops->exit(host);
-
-err_regulator:
 	if (host->vmmc)
 		regulator_disable(host->vmmc);
 
Signature · 1 line
1.7.9.5
#1 lore raw

Hi Jaehoon,

Please check minor thing below.

Quoted 38 lines · Jaehoon Chung

It's right that check immediately whether host->bus_hz is assigned or not.

---
Changelog V3:
- Maintained original place for the drv_data->setup_clock
Changelog V2:
- When drv_data->setup_clock is present, set to bus_hz with it.

 drivers/mmc/host/dw_mmc.c |   22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)
drivers/mmc/host/dw_mmc.c +8 -1
index 8193e21..e7357b8 100644
@@ -2427,12 +2427,19 @@ int dw_mci_probe(struct dw_mci *host)
 			ret = clk_set_rate(host->ciu_clk, host->pdata->bus_hz);
 			if (ret)
 				dev_warn(host->dev,
-					 "Unable to set bus rate to %ul\n",
+					 "Unable to set bus rate to %uHz\n",
 					 host->pdata->bus_hz);
 		}
 		host->bus_hz = clk_get_rate(host->ciu_clk);
 	}
 
+	if (!host->bus_hz) {
+		dev_err(host->dev,
+			"Platform data must supply bus speed\n");
+		ret = -ENODEV;
+		goto err_clk_ciu;
+	}
+
 	if (drv_data && drv_data->init) {
 		ret = drv_data->init(host);
 		if (ret) {

drivers/mmc/host/dw_mmc.c int dw_mci_probe(struct dw_mci *host) · line 2456

Quoted 7 lines
drivers/mmc/host/dw_mmc.c +2 -2
@@ -2445,8 +2452,8 @@ int dw_mci_probe(struct dw_mci *host)
 	if (drv_data && drv_data->setup_clock) {
 		ret = drv_data->setup_clock(host);
 		if (ret) {
-			dev_err(host->dev,
-				"implementation specific clock setup failed\n");
+			dev_err(host->dev, "implementation specific "
+				"clock setup failed\n");

Rather, this change makes cherry-pick warning.
Keep it.

Thanks,
Seungwon Jeon

Quoted 32 lines
drivers/mmc/host/dw_mmc.c +0 -10
 			goto err_clk_ciu;
 		}
 	}
@@ -2469,13 +2476,6 @@ int dw_mci_probe(struct dw_mci *host)
 		}
 	}
 
-	if (!host->bus_hz) {
-		dev_err(host->dev,
-			"Platform data must supply bus speed\n");
-		ret = -ENODEV;
-		goto err_regulator;
-	}
-
 	host->quirks = host->pdata->quirks;
 
 	spin_lock_init(&host->lock);
@@ -2619,8 +2619,6 @@ err_workqueue:
 err_dmaunmap:
 	if (host->use_dma && host->dma_ops->exit)
 		host->dma_ops->exit(host);
-
-err_regulator:
 	if (host->vmmc)
 		regulator_disable(host->vmmc);
 
--

1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#2 lore raw

Dear Seungwon,

Quoted 44 lines · Seungwon Jeon

Hi Jaehoon,

Please check minor thing below.

Quoted 39 lines · Jaehoon Chung

It's right that check immediately whether host->bus_hz is assigned or not.

---
Changelog V3:
- Maintained original place for the drv_data->setup_clock
Changelog V2:
- When drv_data->setup_clock is present, set to bus_hz with it.

 drivers/mmc/host/dw_mmc.c |   22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)
drivers/mmc/host/dw_mmc.c +8 -1
index 8193e21..e7357b8 100644
@@ -2427,12 +2427,19 @@ int dw_mci_probe(struct dw_mci *host)
 			ret = clk_set_rate(host->ciu_clk, host->pdata->bus_hz);
 			if (ret)
 				dev_warn(host->dev,
-					 "Unable to set bus rate to %ul\n",
+					 "Unable to set bus rate to %uHz\n",
 					 host->pdata->bus_hz);
 		}
 		host->bus_hz = clk_get_rate(host->ciu_clk);
 	}
 
+	if (!host->bus_hz) {
+		dev_err(host->dev,
+			"Platform data must supply bus speed\n");
+		ret = -ENODEV;
+		goto err_clk_ciu;
+	}
+
 	if (drv_data && drv_data->init) {
 		ret = drv_data->init(host);
 		if (ret) {
@@ -2445,8 +2452,8 @@ int dw_mci_probe(struct dw_mci *host)
 	if (drv_data && drv_data->setup_clock) {
Quoted 8 lines

drivers/mmc/host/dw_mmc.c int dw_mci_probe(struct dw_mci *host) · line 2456

Quoted 6 lines
drivers/mmc/host/dw_mmc.c +2 -2
 		ret = drv_data->setup_clock(host);
 		if (ret) {
-			dev_err(host->dev,
-				"implementation specific clock setup failed\n");
+			dev_err(host->dev, "implementation specific "
+				"clock setup failed\n");

Rather, this change makes cherry-pick warning.
Keep it.

Check it.

Best Regards,
Jaehoon Chung

Quoted 37 lines

Thanks,
Seungwon Jeon

Quoted 32 lines
drivers/mmc/host/dw_mmc.c +0 -10
 			goto err_clk_ciu;
 		}
 	}
@@ -2469,13 +2476,6 @@ int dw_mci_probe(struct dw_mci *host)
 		}
 	}
 
-	if (!host->bus_hz) {
-		dev_err(host->dev,
-			"Platform data must supply bus speed\n");
-		ret = -ENODEV;
-		goto err_regulator;
-	}
-
 	host->quirks = host->pdata->quirks;
 
 	spin_lock_init(&host->lock);
@@ -2619,8 +2619,6 @@ err_workqueue:
 err_dmaunmap:
 	if (host->use_dma && host->dma_ops->exit)
 		host->dma_ops->exit(host);
-
-err_regulator:
 	if (host->vmmc)
 		regulator_disable(host->vmmc);
 
--

1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html