Skip to content

Commit 3a595f2

Browse files
JordanYatesdanieldegrasse
authored andcommitted
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>
1 parent d8b3775 commit 3a595f2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

subsys/sd/sd.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static int sd_common_init(struct sd_card *card)
108108
LOG_INF("Card does not support CMD8, assuming legacy card");
109109
return sd_idle(card);
110110
} else if (ret) {
111-
LOG_ERR("Card error on CMD 8");
111+
LOG_ERR("Card error on CMD8");
112112
return ret;
113113
}
114114
if (card->host_props.is_spi &&
@@ -135,13 +135,13 @@ static int sd_init_io(struct sd_card *card)
135135
bus_io->timing = SDHC_TIMING_LEGACY;
136136

137137
if (host_props->host_caps.vol_330_support) {
138-
LOG_DBG("Host controller support 3.3V max");
138+
LOG_DBG("Host controller support %sV max", "3.3");
139139
voltage = SD_VOL_3_3_V;
140140
} else if (host_props->host_caps.vol_300_support) {
141-
LOG_DBG("Host controller support 3.0V max");
141+
LOG_DBG("Host controller support %sV max", "3.0");
142142
voltage = SD_VOL_3_0_V;
143143
} else {
144-
LOG_DBG("Host controller support 1.8V max");
144+
LOG_DBG("Host controller support %sV max", "1.8");
145145
voltage = SD_VOL_1_8_V;
146146
}
147147

@@ -153,14 +153,14 @@ static int sd_init_io(struct sd_card *card)
153153
bus_io->power_mode = SDHC_POWER_OFF;
154154
ret = sdhc_set_io(card->sdhc, bus_io);
155155
if (ret) {
156-
LOG_ERR("Could not disable card power via SDHC");
156+
LOG_ERR("Could not %s card power via SDHC", "disable");
157157
return ret;
158158
}
159159
sd_delay(card->host_props.power_delay);
160160
bus_io->power_mode = SDHC_POWER_ON;
161161
ret = sdhc_set_io(card->sdhc, bus_io);
162162
if (ret) {
163-
LOG_ERR("Could not disable card power via SDHC");
163+
LOG_ERR("Could not %s card power via SDHC", "enable");
164164
return ret;
165165
}
166166
/* After reset or init, card voltage should be max HC support */

0 commit comments

Comments
 (0)