Commit b966db0d7259293e2c9c216c7a5dce30dacacfd9
Committed by
Pantelis Antoniou
1 parent
fa7b88519e
Exists in
v2017.01-smarct4x
and in
37 other branches
dw_mmc: cleanups
dw_mmc driver was responding to errors with debug(). Change that to prinf so that any errors are immediately obvious. Also adjust english in comments. Signed-off-by: Pavel Machek <pavel@denx.de> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Showing 1 changed file with 13 additions and 11 deletions Side-by-side Diff
drivers/mmc/dw_mmc.c
... | ... | @@ -177,14 +177,16 @@ |
177 | 177 | } |
178 | 178 | } |
179 | 179 | |
180 | - if (i == retry) | |
180 | + if (i == retry) { | |
181 | + printf("dwmci_send_cmd: timeout..\n"); | |
181 | 182 | return TIMEOUT; |
183 | + } | |
182 | 184 | |
183 | 185 | if (mask & DWMCI_INTMSK_RTO) { |
184 | - debug("Response Timeout..\n"); | |
186 | + printf("dwmci_send_cmd: Response Timeout..\n"); | |
185 | 187 | return TIMEOUT; |
186 | 188 | } else if (mask & DWMCI_INTMSK_RE) { |
187 | - debug("Response Error..\n"); | |
189 | + printf("dwmci_send_cmd: Response Error..\n"); | |
188 | 190 | return -1; |
189 | 191 | } |
190 | 192 | |
... | ... | @@ -204,7 +206,7 @@ |
204 | 206 | do { |
205 | 207 | mask = dwmci_readl(host, DWMCI_RINTSTS); |
206 | 208 | if (mask & (DWMCI_DATA_ERR | DWMCI_DATA_TOUT)) { |
207 | - debug("DATA ERROR!\n"); | |
209 | + printf("dwmci_send_cmd: DATA ERROR!\n"); | |
208 | 210 | return -1; |
209 | 211 | } |
210 | 212 | } while (!(mask & DWMCI_INTMSK_DTO)); |
211 | 213 | |
212 | 214 | |
... | ... | @@ -232,16 +234,16 @@ |
232 | 234 | if ((freq == host->clock) || (freq == 0)) |
233 | 235 | return 0; |
234 | 236 | /* |
235 | - * If host->get_mmc_clk didn't define, | |
237 | + * If host->get_mmc_clk isn't defined, | |
236 | 238 | * then assume that host->bus_hz is source clock value. |
237 | - * host->bus_hz should be set from user. | |
239 | + * host->bus_hz should be set by user. | |
238 | 240 | */ |
239 | 241 | if (host->get_mmc_clk) |
240 | 242 | sclk = host->get_mmc_clk(host); |
241 | 243 | else if (host->bus_hz) |
242 | 244 | sclk = host->bus_hz; |
243 | 245 | else { |
244 | - printf("Didn't get source clock value..\n"); | |
246 | + printf("dwmci_setup_bus: Didn't get source clock value..\n"); | |
245 | 247 | return -EINVAL; |
246 | 248 | } |
247 | 249 | |
... | ... | @@ -260,7 +262,7 @@ |
260 | 262 | do { |
261 | 263 | status = dwmci_readl(host, DWMCI_CMD); |
262 | 264 | if (timeout-- < 0) { |
263 | - printf("TIMEOUT error!!\n"); | |
265 | + printf("dwmci_setup_bus: timeout!\n"); | |
264 | 266 | return -ETIMEDOUT; |
265 | 267 | } |
266 | 268 | } while (status & DWMCI_CMD_START); |
... | ... | @@ -275,7 +277,7 @@ |
275 | 277 | do { |
276 | 278 | status = dwmci_readl(host, DWMCI_CMD); |
277 | 279 | if (timeout-- < 0) { |
278 | - printf("TIMEOUT error!!\n"); | |
280 | + printf("dwmci_setup_bus: timeout!\n"); | |
279 | 281 | return -ETIMEDOUT; |
280 | 282 | } |
281 | 283 | } while (status & DWMCI_CMD_START); |
... | ... | @@ -290,7 +292,7 @@ |
290 | 292 | struct dwmci_host *host = (struct dwmci_host *)mmc->priv; |
291 | 293 | u32 ctype, regs; |
292 | 294 | |
293 | - debug("Buswidth = %d, clock: %d\n",mmc->bus_width, mmc->clock); | |
295 | + debug("Buswidth = %d, clock: %d\n", mmc->bus_width, mmc->clock); | |
294 | 296 | |
295 | 297 | dwmci_setup_bus(host, mmc->clock); |
296 | 298 | switch (mmc->bus_width) { |
... | ... | @@ -329,7 +331,7 @@ |
329 | 331 | dwmci_writel(host, DWMCI_PWREN, 1); |
330 | 332 | |
331 | 333 | if (!dwmci_wait_reset(host, DWMCI_RESET_ALL)) { |
332 | - debug("%s[%d] Fail-reset!!\n",__func__,__LINE__); | |
334 | + printf("%s[%d] Fail-reset!!\n", __func__, __LINE__); | |
333 | 335 | return -1; |
334 | 336 | } |
335 | 337 |