diff mbox series

[05/14] mmc: sdhci-esdhc-imx: no fail when no pinctrl available

Message ID 1573816361-26535-2-git-send-email-haibo.chen@nxp.com (mailing list archive)
State New, archived
Headers show
Series [01/14] mmc: sdhci: do not enable card detect interrupt for gpio cd type | expand

Commit Message

Bough Chen Nov. 15, 2019, 11:12 a.m. UTC
From: Haibo Chen <haibo.chen@nxp.com>

When using jailhouse to support two Linux on i.MX8MQ EVK, we use the
1st Linux to configure pinctrl for the 2nd Linux. Then the 2nd Linux
could use the mmc without pinctrl driver.

So give a warning message when no pinctrl available, but no fail probe.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Adrian Hunter Nov. 26, 2019, 12:51 p.m. UTC | #1
On 15/11/19 1:12 PM, haibo.chen@nxp.com wrote:
> From: Haibo Chen <haibo.chen@nxp.com>
> 
> When using jailhouse to support two Linux on i.MX8MQ EVK, we use the
> 1st Linux to configure pinctrl for the 2nd Linux. Then the 2nd Linux
> could use the mmc without pinctrl driver.
> 
> So give a warning message when no pinctrl available, but no fail probe.
> 
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 25b01f059aca..bc743f82d8c3 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1489,13 +1489,14 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
>  	imx_data->pinctrl = devm_pinctrl_get(&pdev->dev);
>  	if (IS_ERR(imx_data->pinctrl)) {
>  		err = PTR_ERR(imx_data->pinctrl);
> -		goto disable_ahb_clk;
> -	}
> -
> -	imx_data->pins_default = pinctrl_lookup_state(imx_data->pinctrl,
> +		dev_warn(mmc_dev(host->mmc), "could not get pinctrl\n");
> +		imx_data->pins_default = ERR_PTR(-EINVAL);
> +	} else {
> +		imx_data->pins_default = pinctrl_lookup_state(imx_data->pinctrl,
>  						PINCTRL_STATE_DEFAULT);
> -	if (IS_ERR(imx_data->pins_default))
> -		dev_warn(mmc_dev(host->mmc), "could not get default state\n");
> +		if (IS_ERR(imx_data->pins_default))
> +			dev_warn(mmc_dev(host->mmc), "could not get default state\n");
> +	}
>  
>  	if (esdhc_is_usdhc(imx_data)) {
>  		host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN;
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 25b01f059aca..bc743f82d8c3 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1489,13 +1489,14 @@  static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
 	imx_data->pinctrl = devm_pinctrl_get(&pdev->dev);
 	if (IS_ERR(imx_data->pinctrl)) {
 		err = PTR_ERR(imx_data->pinctrl);
-		goto disable_ahb_clk;
-	}
-
-	imx_data->pins_default = pinctrl_lookup_state(imx_data->pinctrl,
+		dev_warn(mmc_dev(host->mmc), "could not get pinctrl\n");
+		imx_data->pins_default = ERR_PTR(-EINVAL);
+	} else {
+		imx_data->pins_default = pinctrl_lookup_state(imx_data->pinctrl,
 						PINCTRL_STATE_DEFAULT);
-	if (IS_ERR(imx_data->pins_default))
-		dev_warn(mmc_dev(host->mmc), "could not get default state\n");
+		if (IS_ERR(imx_data->pins_default))
+			dev_warn(mmc_dev(host->mmc), "could not get default state\n");
+	}
 
 	if (esdhc_is_usdhc(imx_data)) {
 		host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN;