From f35229dd3b0452e254e3a0d3cda9ffa7f03e241b Mon Sep 17 00:00:00 2001 From: Hiren Gohel Date: Sun, 20 Mar 2022 22:02:27 +0530 Subject: [PATCH] mmc: core: Handle err variable properly in shutdown path issue: "mmc0: error -22 during shutdown" logs seen in shutdown path. Initially the err variable is initialized with -EINVAL(22) Before shutting down the eMMC, it make sure that eMMC should be in active state, in order to do so _mmc_resume will be called in mmc_shutdown. Since the device is already in active state it returns from the suspend if check and returns -22 to the mmc_shutdown and treat as error. Making err variable 0 in the if check will help to resolve this issue. Change-Id: I1e34cdce48be3a4db3568cb8442b5aab9110b60c Signed-off-by: Hiren Gohel --- drivers/mmc/core/mmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a77bf0c1bbb4..11b00688aaa6 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -2426,6 +2426,7 @@ static int _mmc_resume(struct mmc_host *host) #if defined(CONFIG_SDC_QTI) if (!mmc_card_suspended(host->card)) { mmc_release_host(host); + err = 0; #else if (!mmc_card_suspended(host->card)) #endif