提交 c8d2a6f3 编写于 作者: A Alessandro Rubini 提交者: Greg Kroah-Hartman

usb: dwc3: use debugfs_print_regs32()

This a use example of the regs32 utilities in debugfs, although
this fuse use ":" as separator between name and value, and debugs
uses "=" (as it looked to me a more common practice).
Signed-off-by: NAlessandro Rubini <rubini@gnudd.com>
Acked-by: NFelipe Balbi <balbi@ti.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 1a087c6a
...@@ -51,18 +51,13 @@ ...@@ -51,18 +51,13 @@
#include "gadget.h" #include "gadget.h"
#include "io.h" #include "io.h"
struct dwc3_register {
const char *name;
u32 offset;
};
#define dump_register(nm) \ #define dump_register(nm) \
{ \ { \
.name = __stringify(nm), \ .name = __stringify(nm), \
.offset = DWC3_ ##nm, \ .offset = DWC3_ ##nm, \
} }
static const struct dwc3_register dwc3_regs[] = { static const struct debugfs_reg32 dwc3_regs[] = {
dump_register(GSBUSCFG0), dump_register(GSBUSCFG0),
dump_register(GSBUSCFG1), dump_register(GSBUSCFG1),
dump_register(GTXTHRCFG), dump_register(GTXTHRCFG),
...@@ -385,12 +380,8 @@ static int dwc3_regdump_show(struct seq_file *s, void *unused) ...@@ -385,12 +380,8 @@ static int dwc3_regdump_show(struct seq_file *s, void *unused)
int i; int i;
seq_printf(s, "DesignWare USB3 Core Register Dump\n"); seq_printf(s, "DesignWare USB3 Core Register Dump\n");
debugfs_print_regs32(s, dwc3_regs, ARRAY_SIZE(dwc3_regs),
for (i = 0; i < ARRAY_SIZE(dwc3_regs); i++) { dwc->regs, "");
seq_printf(s, "%-20s : %08x\n", dwc3_regs[i].name,
dwc3_readl(dwc->regs, dwc3_regs[i].offset));
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册