diff options
author | Jaehoon Chung <jh80.chung@samsung.com> | 2014-03-02 21:36:42 -0500 |
---|---|---|
committer | Chris Ball <chris@printf.net> | 2014-05-12 18:04:32 -0400 |
commit | 612de4c1b3dc2cbe877d39734247d49ab4ba91bd (patch) | |
tree | c3af37a9076602532e4adcf39eec6370cc97b933 /drivers/mmc/host/dw_mmc.c | |
parent | d8a4fb0e60c613d85eda57fd1701177ae2f1c6b5 (diff) |
mmc: dw_mmc: replace the bus_hz checking point
It's right to check immediately whether host->bus_hz is assigned or not.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc/host/dw_mmc.c')
-rw-r--r-- | drivers/mmc/host/dw_mmc.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 8da598f8d96b..55c34cb702d4 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
@@ -2427,12 +2427,19 @@ int dw_mci_probe(struct dw_mci *host) | |||
2427 | ret = clk_set_rate(host->ciu_clk, host->pdata->bus_hz); | 2427 | ret = clk_set_rate(host->ciu_clk, host->pdata->bus_hz); |
2428 | if (ret) | 2428 | if (ret) |
2429 | dev_warn(host->dev, | 2429 | dev_warn(host->dev, |
2430 | "Unable to set bus rate to %ul\n", | 2430 | "Unable to set bus rate to %uHz\n", |
2431 | host->pdata->bus_hz); | 2431 | host->pdata->bus_hz); |
2432 | } | 2432 | } |
2433 | host->bus_hz = clk_get_rate(host->ciu_clk); | 2433 | host->bus_hz = clk_get_rate(host->ciu_clk); |
2434 | } | 2434 | } |
2435 | 2435 | ||
2436 | if (!host->bus_hz) { | ||
2437 | dev_err(host->dev, | ||
2438 | "Platform data must supply bus speed\n"); | ||
2439 | ret = -ENODEV; | ||
2440 | goto err_clk_ciu; | ||
2441 | } | ||
2442 | |||
2436 | if (drv_data && drv_data->init) { | 2443 | if (drv_data && drv_data->init) { |
2437 | ret = drv_data->init(host); | 2444 | ret = drv_data->init(host); |
2438 | if (ret) { | 2445 | if (ret) { |
@@ -2469,13 +2476,6 @@ int dw_mci_probe(struct dw_mci *host) | |||
2469 | } | 2476 | } |
2470 | } | 2477 | } |
2471 | 2478 | ||
2472 | if (!host->bus_hz) { | ||
2473 | dev_err(host->dev, | ||
2474 | "Platform data must supply bus speed\n"); | ||
2475 | ret = -ENODEV; | ||
2476 | goto err_regulator; | ||
2477 | } | ||
2478 | |||
2479 | host->quirks = host->pdata->quirks; | 2479 | host->quirks = host->pdata->quirks; |
2480 | 2480 | ||
2481 | spin_lock_init(&host->lock); | 2481 | spin_lock_init(&host->lock); |
@@ -2619,8 +2619,6 @@ err_workqueue: | |||
2619 | err_dmaunmap: | 2619 | err_dmaunmap: |
2620 | if (host->use_dma && host->dma_ops->exit) | 2620 | if (host->use_dma && host->dma_ops->exit) |
2621 | host->dma_ops->exit(host); | 2621 | host->dma_ops->exit(host); |
2622 | |||
2623 | err_regulator: | ||
2624 | if (host->vmmc) | 2622 | if (host->vmmc) |
2625 | regulator_disable(host->vmmc); | 2623 | regulator_disable(host->vmmc); |
2626 | 2624 | ||