From c8b799bda9a898e97eb0b3ba5fd0e079c9ecaf1c Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 16 Sep 2026 12:15:00 +0200 Subject: [PATCH] F-11013: SDHCI no-base-clock path returns 0 as an error The no-base-clock path disables the clock and returns 0 (error), unlike the already-set path above which returns last_clock_khz. The old NOTE claimed callers could not tell the two apart. --- src/sdhci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdhci.c b/src/sdhci.c index af046f24..f2977c84 100644 --- a/src/sdhci.c +++ b/src/sdhci.c @@ -491,9 +491,9 @@ static uint32_t sdhci_set_clock(uint32_t clock_khz) base_clk_khz = sdhci_platform_set_clock(clock_khz, base_clk_khz); if (base_clk_khz == 0) { /* No usable base clock. The SD clock was already disabled above, so - * the controller is left idle. NOTE: 0 is also what the "clock already - * set" path above returns, so callers cannot currently tell these - * apart - see the DEBUG_SDHCI log for which one happened. */ + * the controller is left idle. This path returns 0 (error), unlike + * the "clock already set" path above which returns last_clock_khz, + * so a 0 return is unambiguously an error for callers. */ #ifdef DEBUG_SDHCI wolfBoot_printf("sdhci_set_clock: no usable base clock " "(CAPS and platform hook both 0)\n");