]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: mmc: correct the logic for setting HS400ES signal voltage
authorHaibo Chen <haibo.chen@nxp.com>
Tue, 8 Aug 2017 10:54:01 +0000 (18:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2017 20:43:17 +0000 (13:43 -0700)
commit 92ddd95919466de5d34f3cb43635da9a7f9ab814 upstream.

Change the default err value to -EINVAL, make sure the card only
has type EXT_CSD_CARD_TYPE_HS400_1_8V also do the signal voltage
setting when select hs400es mode.

Fixes: commit 1720d3545b77 ("mmc: core: switch to 1V8 or 1V2 for hs400es mode")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/core/mmc.c

index 323dba35bc9a8809f8e477eb6bef372e43b881ee..b2ca10c4d2a5c09134438a693fb383d1e740e8f8 100644 (file)
@@ -1258,7 +1258,7 @@ out_err:
 static int mmc_select_hs400es(struct mmc_card *card)
 {
        struct mmc_host *host = card->host;
-       int err = 0;
+       int err = -EINVAL;
        u8 val;
 
        if (!(host->caps & MMC_CAP_8_BIT_DATA)) {