usb: dwc3: use debugfs_print_regs32()
authorAlessandro Rubini <rubini@gnudd.com>
Fri, 18 Nov 2011 13:51:43 +0000 (14:51 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Nov 2011 19:46:32 +0000 (11:46 -0800)
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>
drivers/usb/dwc3/debugfs.c

index da1ad77d8d51bd439e646999d1ef28c547a46960..d9e7a26ee5f0a2234d6b0fc61ee492efe3553526 100644 (file)
 #include "gadget.h"
 #include "io.h"
 
-struct dwc3_register {
-       const char      *name;
-       u32             offset;
-};
-
 #define dump_register(nm)                              \
 {                                                      \
        .name   = __stringify(nm),                      \
        .offset = DWC3_ ##nm,                           \
 }
 
-static const struct dwc3_register dwc3_regs[] = {
+static const struct debugfs_reg32 dwc3_regs[] = {
        dump_register(GSBUSCFG0),
        dump_register(GSBUSCFG1),
        dump_register(GTXTHRCFG),
@@ -385,12 +380,8 @@ static int dwc3_regdump_show(struct seq_file *s, void *unused)
        int                     i;
 
        seq_printf(s, "DesignWare USB3 Core Register Dump\n");
-
-       for (i = 0; i < ARRAY_SIZE(dwc3_regs); i++) {
-               seq_printf(s, "%-20s :    %08x\n", dwc3_regs[i].name,
-                               dwc3_readl(dwc->regs, dwc3_regs[i].offset));
-       }
-
+       debugfs_print_regs32(s, dwc3_regs, ARRAY_SIZE(dwc3_regs),
+                            dwc->regs, "");
        return 0;
 }