From 3a595f28592ae31ebb5e83653f8948ec88769b87 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Fri, 30 May 2025 14:15:58 +1000 Subject: [PATCH] sd: fix incorrect error logging Fix logging `Could not disable card power via SDHC` when the attempted operation is turning power on. Update several other logging strings to minimise the number of unique strings required. Signed-off-by: Jordan Yates --- subsys/sd/sd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/subsys/sd/sd.c b/subsys/sd/sd.c index d8c28914380..e48629ca503 100644 --- a/subsys/sd/sd.c +++ b/subsys/sd/sd.c @@ -108,7 +108,7 @@ static int sd_common_init(struct sd_card *card) LOG_INF("Card does not support CMD8, assuming legacy card"); return sd_idle(card); } else if (ret) { - LOG_ERR("Card error on CMD 8"); + LOG_ERR("Card error on CMD8"); return ret; } if (card->host_props.is_spi && @@ -135,13 +135,13 @@ static int sd_init_io(struct sd_card *card) bus_io->timing = SDHC_TIMING_LEGACY; if (host_props->host_caps.vol_330_support) { - LOG_DBG("Host controller support 3.3V max"); + LOG_DBG("Host controller support %sV max", "3.3"); voltage = SD_VOL_3_3_V; } else if (host_props->host_caps.vol_300_support) { - LOG_DBG("Host controller support 3.0V max"); + LOG_DBG("Host controller support %sV max", "3.0"); voltage = SD_VOL_3_0_V; } else { - LOG_DBG("Host controller support 1.8V max"); + LOG_DBG("Host controller support %sV max", "1.8"); voltage = SD_VOL_1_8_V; } @@ -153,14 +153,14 @@ static int sd_init_io(struct sd_card *card) bus_io->power_mode = SDHC_POWER_OFF; ret = sdhc_set_io(card->sdhc, bus_io); if (ret) { - LOG_ERR("Could not disable card power via SDHC"); + LOG_ERR("Could not %s card power via SDHC", "disable"); return ret; } sd_delay(card->host_props.power_delay); bus_io->power_mode = SDHC_POWER_ON; ret = sdhc_set_io(card->sdhc, bus_io); if (ret) { - LOG_ERR("Could not disable card power via SDHC"); + LOG_ERR("Could not %s card power via SDHC", "enable"); return ret; } /* After reset or init, card voltage should be max HC support */