diff options
author | Alessandro Rubini <rubini@gnudd.com> | 2011-11-18 08:51:43 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-18 14:46:32 -0500 |
commit | c8d2a6f3999e175c4d564c445c7f1ececd926453 (patch) | |
tree | 61daadcee4c1ecd5bd53f0fe484fc0b125aaeb22 | |
parent | 1a087c6ad975bcc193b4bab2e9d61f9c6c547138 (diff) |
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: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/dwc3/debugfs.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c index da1ad77d8d51..d9e7a26ee5f0 100644 --- a/drivers/usb/dwc3/debugfs.c +++ b/drivers/usb/dwc3/debugfs.c | |||
@@ -51,18 +51,13 @@ | |||
51 | #include "gadget.h" | 51 | #include "gadget.h" |
52 | #include "io.h" | 52 | #include "io.h" |
53 | 53 | ||
54 | struct dwc3_register { | ||
55 | const char *name; | ||
56 | u32 offset; | ||
57 | }; | ||
58 | |||
59 | #define dump_register(nm) \ | 54 | #define dump_register(nm) \ |
60 | { \ | 55 | { \ |
61 | .name = __stringify(nm), \ | 56 | .name = __stringify(nm), \ |
62 | .offset = DWC3_ ##nm, \ | 57 | .offset = DWC3_ ##nm, \ |
63 | } | 58 | } |
64 | 59 | ||
65 | static const struct dwc3_register dwc3_regs[] = { | 60 | static const struct debugfs_reg32 dwc3_regs[] = { |
66 | dump_register(GSBUSCFG0), | 61 | dump_register(GSBUSCFG0), |
67 | dump_register(GSBUSCFG1), | 62 | dump_register(GSBUSCFG1), |
68 | dump_register(GTXTHRCFG), | 63 | dump_register(GTXTHRCFG), |
@@ -385,12 +380,8 @@ static int dwc3_regdump_show(struct seq_file *s, void *unused) | |||
385 | int i; | 380 | int i; |
386 | 381 | ||
387 | seq_printf(s, "DesignWare USB3 Core Register Dump\n"); | 382 | seq_printf(s, "DesignWare USB3 Core Register Dump\n"); |
388 | 383 | debugfs_print_regs32(s, dwc3_regs, ARRAY_SIZE(dwc3_regs), | |
389 | for (i = 0; i < ARRAY_SIZE(dwc3_regs); i++) { | 384 | dwc->regs, ""); |
390 | seq_printf(s, "%-20s : %08x\n", dwc3_regs[i].name, | ||
391 | dwc3_readl(dwc->regs, dwc3_regs[i].offset)); | ||
392 | } | ||
393 | |||
394 | return 0; | 385 | return 0; |
395 | } | 386 | } |
396 | 387 | ||