Commit 69b8b224 authored by Fabio Falzoi's avatar Fabio Falzoi Committed by Greg Kroah-Hartman

Staging: rts5208: Use dev_dbg and print_hex_dump_bytes to dump memory

Use dev_dbg with %*ph format specifier and print_hex_dump_bytes to dump memory
instead of relying on custom macro.
Signed-off-by: default avatarFabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 63bc5164
...@@ -305,7 +305,8 @@ static int ms_read_bytes(struct rtsx_chip *chip, ...@@ -305,7 +305,8 @@ static int ms_read_bytes(struct rtsx_chip *chip,
if ((tpc == PRO_READ_SHORT_DATA) && (data_len == 8)) { if ((tpc == PRO_READ_SHORT_DATA) && (data_len == 8)) {
dev_dbg(rtsx_dev(chip), "Read format progress:\n"); dev_dbg(rtsx_dev(chip), "Read format progress:\n");
RTSX_DUMP(ptr, cnt); print_hex_dump_bytes(KBUILD_MODNAME ": ", DUMP_PREFIX_NONE, ptr,
cnt);
} }
return STATUS_SUCCESS; return STATUS_SUCCESS;
...@@ -1913,7 +1914,7 @@ static int reset_ms(struct rtsx_chip *chip) ...@@ -1913,7 +1914,7 @@ static int reset_ms(struct rtsx_chip *chip)
ptr = rtsx_get_cmd_data(chip); ptr = rtsx_get_cmd_data(chip);
dev_dbg(rtsx_dev(chip), "Boot block data:\n"); dev_dbg(rtsx_dev(chip), "Boot block data:\n");
RTSX_DUMP(ptr, 16); dev_dbg(rtsx_dev(chip), "%*ph\n", 16, ptr);
/* Block ID error /* Block ID error
* HEADER_ID0, HEADER_ID1 * HEADER_ID0, HEADER_ID1
......
...@@ -1309,8 +1309,10 @@ int rtsx_write_cfg_seq(struct rtsx_chip *chip, u8 func, u16 addr, u8 *buf, ...@@ -1309,8 +1309,10 @@ int rtsx_write_cfg_seq(struct rtsx_chip *chip, u8 func, u16 addr, u8 *buf,
} }
} }
RTSX_DUMP(mask, dw_len * 4); print_hex_dump_bytes(KBUILD_MODNAME ": ", DUMP_PREFIX_NONE, mask,
RTSX_DUMP(data, dw_len * 4); dw_len * 4);
print_hex_dump_bytes(KBUILD_MODNAME ": ", DUMP_PREFIX_NONE, data,
dw_len * 4);
for (i = 0; i < dw_len; i++) { for (i = 0; i < dw_len; i++) {
retval = rtsx_write_cfg_dw(chip, func, aligned_addr + i * 4, retval = rtsx_write_cfg_dw(chip, func, aligned_addr + i * 4,
......
...@@ -39,7 +39,7 @@ void scsi_show_command(struct rtsx_chip *chip) ...@@ -39,7 +39,7 @@ void scsi_show_command(struct rtsx_chip *chip)
{ {
struct scsi_cmnd *srb = chip->srb; struct scsi_cmnd *srb = chip->srb;
char *what = NULL; char *what = NULL;
int i, unknown_cmd = 0; int unknown_cmd = 0, len;
switch (srb->cmnd[0]) { switch (srb->cmnd[0]) {
case TEST_UNIT_READY: case TEST_UNIT_READY:
...@@ -319,9 +319,8 @@ void scsi_show_command(struct rtsx_chip *chip) ...@@ -319,9 +319,8 @@ void scsi_show_command(struct rtsx_chip *chip)
what, srb->cmd_len); what, srb->cmd_len);
if (unknown_cmd) { if (unknown_cmd) {
for (i = 0; i < srb->cmd_len && i < 16; i++) len = min_t(unsigned short, srb->cmd_len, 16);
dev_dbg(rtsx_dev(chip), " %02x", srb->cmnd[i]); dev_dbg(rtsx_dev(chip), "%*ph\n", len, srb->cmnd);
dev_dbg(rtsx_dev(chip), "\n");
} }
} }
......
...@@ -427,7 +427,7 @@ static int sd_check_csd(struct rtsx_chip *chip, char check_wp) ...@@ -427,7 +427,7 @@ static int sd_check_csd(struct rtsx_chip *chip, char check_wp)
memcpy(sd_card->raw_csd, rsp + 1, 15); memcpy(sd_card->raw_csd, rsp + 1, 15);
dev_dbg(rtsx_dev(chip), "CSD Response:\n"); dev_dbg(rtsx_dev(chip), "CSD Response:\n");
RTSX_DUMP(sd_card->raw_csd, 16); dev_dbg(rtsx_dev(chip), "%*ph\n", 16, sd_card->raw_csd);
csd_ver = (rsp[1] & 0xc0) >> 6; csd_ver = (rsp[1] & 0xc0) >> 6;
dev_dbg(rtsx_dev(chip), "csd_ver = %d\n", csd_ver); dev_dbg(rtsx_dev(chip), "csd_ver = %d\n", csd_ver);
...@@ -1060,7 +1060,7 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode, ...@@ -1060,7 +1060,7 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode,
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
} }
RTSX_DUMP(buf, 64); dev_dbg(rtsx_dev(chip), "%*ph\n", 64, buf);
if (func_group == NO_ARGUMENT) { if (func_group == NO_ARGUMENT) {
sd_card->func_group1_mask = buf[0x0D]; sd_card->func_group1_mask = buf[0x0D];
...@@ -2119,7 +2119,7 @@ static int sd_check_wp_state(struct rtsx_chip *chip) ...@@ -2119,7 +2119,7 @@ static int sd_check_wp_state(struct rtsx_chip *chip)
} }
dev_dbg(rtsx_dev(chip), "ACMD13:\n"); dev_dbg(rtsx_dev(chip), "ACMD13:\n");
RTSX_DUMP(buf, 64); dev_dbg(rtsx_dev(chip), "%*ph\n", 64, buf);
sd_card_type = ((u16)buf[2] << 8) | buf[3]; sd_card_type = ((u16)buf[2] << 8) | buf[3];
dev_dbg(rtsx_dev(chip), "sd_card_type = 0x%04x\n", sd_card_type); dev_dbg(rtsx_dev(chip), "sd_card_type = 0x%04x\n", sd_card_type);
......
...@@ -84,12 +84,4 @@ static inline char *filename(char *path) ...@@ -84,12 +84,4 @@ static inline char *filename(char *path)
#define TRACE_GOTO(chip, label) goto label #define TRACE_GOTO(chip, label) goto label
#endif #endif
#ifdef CONFIG_RTS5208_DEBUG
#define RTSX_DUMP(buf, buf_len) \
print_hex_dump(KERN_DEBUG, KBUILD_MODNAME ": ", \
DUMP_PREFIX_NONE, 16, 1, (buf), (buf_len), false)
#else
#define RTSX_DUMP(buf, buf_len)
#endif
#endif /* __REALTEK_RTSX_TRACE_H */ #endif /* __REALTEK_RTSX_TRACE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment