diff mbox

[RFC,2/3] mmc: dw_mmc: move the platform specific init call

Message ID 1376894176-2702-2-git-send-email-yuvaraj.cd@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yuvaraj CD Aug. 19, 2013, 6:36 a.m. UTC
Current platform specific private data initialisation call
dw_mci_exynos_priv_init can be used to do platform specific
initialisation of SMU and others in future.So the drv_data->init
call has moved to dw_mci_probe.

Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
---
 drivers/mmc/host/dw_mmc-pltfm.c |    7 -------
 drivers/mmc/host/dw_mmc.c       |    9 +++++++++
 2 files changed, 9 insertions(+), 7 deletions(-)

Comments

Seungwon Jeon Aug. 20, 2013, 11:34 a.m. UTC | #1
Hi Yuvaraj,

This change affects dw_mci_socfpga_parse_dt of socfpga.
It should be considered.

Thanks,
Seungwon Jeon

On Mon, August 19, 2013, Yuvaraj Kumar C D wrote:
> Current platform specific private data initialisation call
> dw_mci_exynos_priv_init can be used to do platform specific
> initialisation of SMU and others in future.So the drv_data->init
> call has moved to dw_mci_probe.
> 
> Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
> ---
>  drivers/mmc/host/dw_mmc-pltfm.c |    7 -------
>  drivers/mmc/host/dw_mmc.c       |    9 +++++++++
>  2 files changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
> index ee52556..a570da4 100644
> --- a/drivers/mmc/host/dw_mmc-pltfm.c
> +++ b/drivers/mmc/host/dw_mmc-pltfm.c
> @@ -38,7 +38,6 @@ int dw_mci_pltfm_register(struct platform_device *pdev,
>  {
>  	struct dw_mci *host;
>  	struct resource	*regs;
> -	int ret;
> 
>  	host = devm_kzalloc(&pdev->dev, sizeof(struct dw_mci), GFP_KERNEL);
>  	if (!host)
> @@ -58,12 +57,6 @@ int dw_mci_pltfm_register(struct platform_device *pdev,
>  	if (IS_ERR(host->regs))
>  		return PTR_ERR(host->regs);
> 
> -	if (drv_data && drv_data->init) {
> -		ret = drv_data->init(host);
> -		if (ret)
> -			return ret;
> -	}
> -
>  	platform_set_drvdata(pdev, host);
>  	return dw_mci_probe(host);
>  }
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index ee5f167..0c0cada 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2222,6 +2222,15 @@ int dw_mci_probe(struct dw_mci *host)
>  		host->bus_hz = clk_get_rate(host->ciu_clk);
>  	}
> 
> +	if (drv_data && drv_data->init) {
> +		ret = drv_data->init(host);
> +		if (ret) {
> +			dev_err(host->dev,
> +				"implementation specific init failed\n");
> +			goto err_clk_ciu;
> +		}
> +	}
> +
>  	if (drv_data && drv_data->setup_clock) {
>  		ret = drv_data->setup_clock(host);
>  		if (ret) {
> --
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
index ee52556..a570da4 100644
--- a/drivers/mmc/host/dw_mmc-pltfm.c
+++ b/drivers/mmc/host/dw_mmc-pltfm.c
@@ -38,7 +38,6 @@  int dw_mci_pltfm_register(struct platform_device *pdev,
 {
 	struct dw_mci *host;
 	struct resource	*regs;
-	int ret;
 
 	host = devm_kzalloc(&pdev->dev, sizeof(struct dw_mci), GFP_KERNEL);
 	if (!host)
@@ -58,12 +57,6 @@  int dw_mci_pltfm_register(struct platform_device *pdev,
 	if (IS_ERR(host->regs))
 		return PTR_ERR(host->regs);
 
-	if (drv_data && drv_data->init) {
-		ret = drv_data->init(host);
-		if (ret)
-			return ret;
-	}
-
 	platform_set_drvdata(pdev, host);
 	return dw_mci_probe(host);
 }
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index ee5f167..0c0cada 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2222,6 +2222,15 @@  int dw_mci_probe(struct dw_mci *host)
 		host->bus_hz = clk_get_rate(host->ciu_clk);
 	}
 
+	if (drv_data && drv_data->init) {
+		ret = drv_data->init(host);
+		if (ret) {
+			dev_err(host->dev,
+				"implementation specific init failed\n");
+			goto err_clk_ciu;
+		}
+	}
+
 	if (drv_data && drv_data->setup_clock) {
 		ret = drv_data->setup_clock(host);
 		if (ret) {