Skip to contentSkip to conversation

mmc: dw-mmc: check the host->bus_hz before calling

PATCH In review Jaehoon Chung 2 participants 2 messages Feb 18, 2013 – Feb 19, 2013

Subsystems (2)
lore
Share & tools
lore

Jaehoon Chung

author maintainer
#0 lore raw

PATCH 1/2 mmc: dw-mmc: check the host->bus_hz before calling

Check whether host->bus_hz is zero or not. before calling drv_data->setup_clock.

---
 drivers/mmc/host/dw_mmc.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/mmc/host/dw_mmc.c +7 -7
index 60063cc..c59078c 100644
@@ -2203,6 +2203,13 @@ int dw_mci_probe(struct dw_mci *host)
 	else
 		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->setup_clock) {
 		ret = drv_data->setup_clock(host);
 		if (ret) {
@@ -2212,13 +2219,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_clk_ciu;
-	}
-
 	host->quirks = host->pdata->quirks;
 
 	spin_lock_init(&host->lock);
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 27 lines · Jaehoon Chung

Check whether host->bus_hz is zero or not. before calling drv_data->setup_clock.

---
 drivers/mmc/host/dw_mmc.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/mmc/host/dw_mmc.c +7 -0
index 60063cc..c59078c 100644
@@ -2203,6 +2203,13 @@ int dw_mci_probe(struct dw_mci *host)
 	else
 		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->setup_clock) {
 		ret = drv_data->setup_clock(host);
 		if (ret) {

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

Quoted 10 lines
drivers/mmc/host/dw_mmc.c +0 -7
@@ -2212,13 +2219,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_clk_ciu;
-	}
-

Currently checking 'host->bus_hz' is following 'setup_clock'
If specific implementation for 'setup_clock' is present, bus_hz may be updated. When considering multiple platforms, it looks like proper.
Could you check the patch for more?
[PATCH v5 9/9] mmc: dw_mmc: add support for exynos specific implementation of dw-mshc

Thanks,
Seungwon Jeon

Quoted 9 lines
drivers/mmc/host/dw_mmc.c +0 -1
 	host->quirks = host->pdata->quirks;
 
 	spin_lock_init(&host->lock);
--

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