linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 2/7] mmc: dw_mmc: replace the bus_hz checking point
@ 2014-03-03  2:36 Jaehoon Chung
  2014-03-06  7:27 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Jaehoon Chung @ 2014-03-03  2:36 UTC (permalink / raw)
  To: linux-mmc@vger.kernel.org; +Cc: Chris Ball, Ulf Hansson, Seungwon Jeon

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

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
Changelog V4:
	- Fixed the compile warning.
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 |   18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 8193e21..3970fc3 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)
 			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) {
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v4 2/7] mmc: dw_mmc: replace the bus_hz checking point
  2014-03-03  2:36 [PATCH v4 2/7] mmc: dw_mmc: replace the bus_hz checking point Jaehoon Chung
@ 2014-03-06  7:27 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2014-03-06  7:27 UTC (permalink / raw)
  To: Jaehoon Chung; +Cc: linux-mmc@vger.kernel.org, Chris Ball, Seungwon Jeon

On 3 March 2014 03:36, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> It's right that check immediately whether host->bus_hz is assigned or not.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---
> Changelog V4:
>         - Fixed the compile warning.
> 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 |   18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 8193e21..3970fc3 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)
>                         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) {
> @@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-06  7:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-03  2:36 [PATCH v4 2/7] mmc: dw_mmc: replace the bus_hz checking point Jaehoon Chung
2014-03-06  7:27 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).