aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2011-02-08 17:25:22 -0500
committerChris Ball <cjb@laptop.org>2011-03-15 13:48:46 -0400
commita803d7fbc1ae64244eb8738aa0e4ac491b45d26c (patch)
treee684ee04233b2bacfd384dad80aa08f0a1dffc10 /drivers/mmc
parenta803d551d92079beb599cc37fa407c059c82c821 (diff)
mmc: tmio_mmc: Improve readability of the output of pr_debug_status()
Reviewed-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/tmio_mmc.c50
1 files changed, 27 insertions, 23 deletions
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index e3c6ef208391..a33f71841dec 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -228,36 +228,40 @@ static void tmio_mmc_kunmap_atomic(void *virt, unsigned long *flags)
228 228
229#ifdef CONFIG_MMC_DEBUG 229#ifdef CONFIG_MMC_DEBUG
230 230
231#define STATUS_TO_TEXT(a) \ 231#define STATUS_TO_TEXT(a, status, i) \
232 do { \ 232 do { \
233 if (status & TMIO_STAT_##a) \ 233 if (status & TMIO_STAT_##a) { \
234 if (i++) \
235 printk(" | "); \
234 printk(#a); \ 236 printk(#a); \
237 } \
235 } while (0) 238 } while (0)
236 239
237void pr_debug_status(u32 status) 240void pr_debug_status(u32 status)
238{ 241{
242 int i = 0;
239 printk(KERN_DEBUG "status: %08x = ", status); 243 printk(KERN_DEBUG "status: %08x = ", status);
240 STATUS_TO_TEXT(CARD_REMOVE); 244 STATUS_TO_TEXT(CARD_REMOVE, status, i);
241 STATUS_TO_TEXT(CARD_INSERT); 245 STATUS_TO_TEXT(CARD_INSERT, status, i);
242 STATUS_TO_TEXT(SIGSTATE); 246 STATUS_TO_TEXT(SIGSTATE, status, i);
243 STATUS_TO_TEXT(WRPROTECT); 247 STATUS_TO_TEXT(WRPROTECT, status, i);
244 STATUS_TO_TEXT(CARD_REMOVE_A); 248 STATUS_TO_TEXT(CARD_REMOVE_A, status, i);
245 STATUS_TO_TEXT(CARD_INSERT_A); 249 STATUS_TO_TEXT(CARD_INSERT_A, status, i);
246 STATUS_TO_TEXT(SIGSTATE_A); 250 STATUS_TO_TEXT(SIGSTATE_A, status, i);
247 STATUS_TO_TEXT(CMD_IDX_ERR); 251 STATUS_TO_TEXT(CMD_IDX_ERR, status, i);
248 STATUS_TO_TEXT(STOPBIT_ERR); 252 STATUS_TO_TEXT(STOPBIT_ERR, status, i);
249 STATUS_TO_TEXT(ILL_FUNC); 253 STATUS_TO_TEXT(ILL_FUNC, status, i);
250 STATUS_TO_TEXT(CMD_BUSY); 254 STATUS_TO_TEXT(CMD_BUSY, status, i);
251 STATUS_TO_TEXT(CMDRESPEND); 255 STATUS_TO_TEXT(CMDRESPEND, status, i);
252 STATUS_TO_TEXT(DATAEND); 256 STATUS_TO_TEXT(DATAEND, status, i);
253 STATUS_TO_TEXT(CRCFAIL); 257 STATUS_TO_TEXT(CRCFAIL, status, i);
254 STATUS_TO_TEXT(DATATIMEOUT); 258 STATUS_TO_TEXT(DATATIMEOUT, status, i);
255 STATUS_TO_TEXT(CMDTIMEOUT); 259 STATUS_TO_TEXT(CMDTIMEOUT, status, i);
256 STATUS_TO_TEXT(RXOVERFLOW); 260 STATUS_TO_TEXT(RXOVERFLOW, status, i);
257 STATUS_TO_TEXT(TXUNDERRUN); 261 STATUS_TO_TEXT(TXUNDERRUN, status, i);
258 STATUS_TO_TEXT(RXRDY); 262 STATUS_TO_TEXT(RXRDY, status, i);
259 STATUS_TO_TEXT(TXRQ); 263 STATUS_TO_TEXT(TXRQ, status, i);
260 STATUS_TO_TEXT(ILL_ACCESS); 264 STATUS_TO_TEXT(ILL_ACCESS, status, i);
261 printk("\n"); 265 printk("\n");
262} 266}
263 267