[PATCH 5/6] mmc: mmci: stm32: fail the probe if the private structure can't be allocated

From: Christophe Kerello

Date: Tue Dec 01 2026 - 11:22:27 EST


When the private structure can't be allocated, sdmmc_variant_init()
continues without the delay block, so tuning silently stops being
available.

Now that the variant init can return an error, fail the probe with
-ENOMEM instead. A missing or unmappable delay block region is still
silently ignored, as the delay block is optional.

Signed-off-by: Christophe Kerello <christophe.kerello@xxxxxxxxxxx>
---
drivers/mmc/host/mmci_stm32_sdmmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mmci_stm32_sdmmc.c b/drivers/mmc/host/mmci_stm32_sdmmc.c
index 9c4098ce9b73..322bfe0a0945 100644
--- a/drivers/mmc/host/mmci_stm32_sdmmc.c
+++ b/drivers/mmc/host/mmci_stm32_sdmmc.c
@@ -761,7 +761,7 @@ int sdmmc_variant_init(struct mmci_host *host)

priv = devm_kzalloc(mmc_dev(host->mmc), sizeof(*priv), GFP_KERNEL);
if (!priv)
- return 0;
+ return -ENOMEM;

dlyb = &priv->dlyb;
dlyb->base = base;

--
2.43.0