From 47ab5818e88af2872a6ff4b1c041978f85bfd77f Mon Sep 17 00:00:00 2001 From: lintao Date: Wed, 26 Mar 2014 17:03:27 +0800 Subject: [PATCH] mmc: host: rockchip: add warning for non-pinctrl project --- drivers/mmc/host/rk_sdmmc.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/rk_sdmmc.c b/drivers/mmc/host/rk_sdmmc.c index 9376d11d6b31..9edfa35867e7 100755 --- a/drivers/mmc/host/rk_sdmmc.c +++ b/drivers/mmc/host/rk_sdmmc.c @@ -2653,15 +2653,24 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) /* Pinctrl set default iomux state to fucntion port. * Fixme: DON'T TOUCH EMMC SETTING! */ - if(!(host->mmc->restrict_caps & RESTRICT_CARD_TYPE_EMMC)) - { + if(!(host->mmc->restrict_caps & RESTRICT_CARD_TYPE_EMMC)) + { host->pinctrl = devm_pinctrl_get(host->dev); - host->pins_default = pinctrl_lookup_state(host->pinctrl,PINCTRL_STATE_DEFAULT); - if(!host->pins_default) - pinctrl_select_state(host->pinctrl, host->pins_default); + if(IS_ERR(host->pinctrl)) + printk("%s: Warning : No pinctrl used!\n",mmc_hostname(host->mmc)); else - printk("%s: Warning : No default pinctrl matched!\n",mmc_hostname(host->mmc)); - } + { + host->pins_default = pinctrl_lookup_state(host->pinctrl,PINCTRL_STATE_DEFAULT); + if(IS_ERR(host->pins_default)) + printk("%s: Warning : No default pinctrl matched!\n", mmc_hostname(host->mmc)); + else + { + if(pinctrl_select_state(host->pinctrl, host->pins_default) < 0) + printk("%s: Warning : Default pinctrl setting failed!\n", mmc_hostname(host->mmc)); + } + } + } + #if defined(CONFIG_DEBUG_FS) dw_mci_init_debugfs(slot); -- 2.34.1