diff options
Diffstat (limited to 'drivers/staging/rts5139')
-rw-r--r-- | drivers/staging/rts5139/rts51x_fop.c | 2 | ||||
-rw-r--r-- | drivers/staging/rts5139/trace.h | 32 |
2 files changed, 4 insertions, 30 deletions
diff --git a/drivers/staging/rts5139/rts51x_fop.c b/drivers/staging/rts5139/rts51x_fop.c index e1200fe..bf1a9e6 100644 --- a/drivers/staging/rts5139/rts51x_fop.c +++ b/drivers/staging/rts5139/rts51x_fop.c @@ -79,7 +79,7 @@ static int rts51x_sd_direct_cmnd(struct rts51x_chip *chip, case 1: /* Read from card */ - buf = kmalloc(cmnd->buf_len, GFP_KERNEL); + buf = kzalloc(cmnd->buf_len, GFP_KERNEL); if (!buf) TRACE_RET(chip, STATUS_NOMEM); diff --git a/drivers/staging/rts5139/trace.h b/drivers/staging/rts5139/trace.h index 0584b8a..c9dfb1e 100644 --- a/drivers/staging/rts5139/trace.h +++ b/drivers/staging/rts5139/trace.h @@ -93,35 +93,9 @@ do { \ #endif #ifdef CONFIG_RTS5139_DEBUG -static inline void rts51x_dump(u8 *buf, int buf_len) -{ - int i; - u8 tmp[16] = { 0 }; - u8 *_ptr = buf; - - for (i = 0; i < ((buf_len) / 16); i++) { - RTS51X_DEBUGP("%02x %02x %02x %02x %02x %02x %02x %02x " - "%02x %02x %02x %02x %02x %02x %02x %02x\n", - _ptr[0], _ptr[1], _ptr[2], _ptr[3], _ptr[4], - _ptr[5], _ptr[6], _ptr[7], _ptr[8], _ptr[9], - _ptr[10], _ptr[11], _ptr[12], _ptr[13], _ptr[14], - _ptr[15]); - _ptr += 16; - } - if ((buf_len) % 16) { - memcpy(tmp, _ptr, (buf_len) % 16); - _ptr = tmp; - RTS51X_DEBUGP("%02x %02x %02x %02x %02x %02x %02x %02x " - "%02x %02x %02x %02x %02x %02x %02x %02x\n", - _ptr[0], _ptr[1], _ptr[2], _ptr[3], _ptr[4], - _ptr[5], _ptr[6], _ptr[7], _ptr[8], _ptr[9], - _ptr[10], _ptr[11], _ptr[12], _ptr[13], _ptr[14], - _ptr[15]); - } -} - -#define RTS51X_DUMP(buf, buf_len) \ - rts51x_dump((u8 *)(buf), (buf_len)) +#define RTS51X_DUMP(buf, buf_len) \ + print_hex_dump(KERN_DEBUG, RTS51X_TIP, DUMP_PREFIX_NONE, \ + 16, 1, (buf), (buf_len), false) #define CATCH_TRIGGER(chip) \ do { \ |