Browse Source

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 <jordan@embeint.com>
pull/91167/head
Jordan Yates 1 month ago committed by Daniel DeGrasse
parent
commit
3a595f2859
  1. 10
      subsys/sd/sd.c

10
subsys/sd/sd.c

@ -135,13 +135,13 @@ static int sd_init_io(struct sd_card *card)
bus_io->timing = SDHC_TIMING_LEGACY; bus_io->timing = SDHC_TIMING_LEGACY;
if (host_props->host_caps.vol_330_support) { 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; voltage = SD_VOL_3_3_V;
} else if (host_props->host_caps.vol_300_support) { } 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; voltage = SD_VOL_3_0_V;
} else { } else {
LOG_DBG("Host controller support 1.8V max"); LOG_DBG("Host controller support %sV max", "1.8");
voltage = SD_VOL_1_8_V; 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; bus_io->power_mode = SDHC_POWER_OFF;
ret = sdhc_set_io(card->sdhc, bus_io); ret = sdhc_set_io(card->sdhc, bus_io);
if (ret) { if (ret) {
LOG_ERR("Could not disable card power via SDHC"); LOG_ERR("Could not %s card power via SDHC", "disable");
return ret; return ret;
} }
sd_delay(card->host_props.power_delay); sd_delay(card->host_props.power_delay);
bus_io->power_mode = SDHC_POWER_ON; bus_io->power_mode = SDHC_POWER_ON;
ret = sdhc_set_io(card->sdhc, bus_io); ret = sdhc_set_io(card->sdhc, bus_io);
if (ret) { if (ret) {
LOG_ERR("Could not disable card power via SDHC"); LOG_ERR("Could not %s card power via SDHC", "enable");
return ret; return ret;
} }
/* After reset or init, card voltage should be max HC support */ /* After reset or init, card voltage should be max HC support */

Loading…
Cancel
Save