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.
pull/892/head
Daniele Lacamera 2026-09-16 12:15:00 +02:00
parent e32ea8a659
commit c8b799bda9
1 changed files with 3 additions and 3 deletions

View File

@ -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");