Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH v2] mmc: sdhci-omap: Add error handling for sdhci_runtime_suspend_host()
@ 2025-05-21  8:38 Wentao Liang
  2025-05-30 12:28 ` Adrian Hunter
  0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2025-05-21  8:38 UTC (permalink / raw)
  To: adrian.hunter, vigneshr, ulf.hansson
  Cc: linux-mmc, linux-kernel, Wentao Liang, stable

The sdhci_omap_runtime_suspend() calls sdhci_runtime_suspend_host() but
does not handle the return value. A proper implementation can be found
in sdhci_am654_runtime_suspend().

Add error handling for sdhci_runtime_suspend_host(). Return the error
code if the suspend fails.

Fixes: 51189eb9ddc8 ("mmc: sdhci-omap: Fix a lockdep warning for PM runtime init")
Cc: stable@vger.kernel.org # 5.19
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
v2: Fix code error.

 drivers/mmc/host/sdhci-omap.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
index 54d795205fb4..f09f78cf244d 100644
--- a/drivers/mmc/host/sdhci-omap.c
+++ b/drivers/mmc/host/sdhci-omap.c
@@ -1438,12 +1438,16 @@ static int __maybe_unused sdhci_omap_runtime_suspend(struct device *dev)
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 	struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host);
+	int ret;
 
 	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
 		mmc_retune_needed(host->mmc);
 
-	if (omap_host->con != -EINVAL)
-		sdhci_runtime_suspend_host(host);
+	if (omap_host->con != -EINVAL) {
+		ret = sdhci_runtime_suspend_host(host);
+		if (ret)
+			return ret;
+	}
 
 	sdhci_omap_context_save(omap_host);
 
-- 
2.42.0.windows.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-30 12:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21  8:38 [PATCH v2] mmc: sdhci-omap: Add error handling for sdhci_runtime_suspend_host() Wentao Liang
2025-05-30 12:28 ` Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox