From: Alessandro Rubini <rubini@gnudd.com>
To: gregkh@suse.de, linux-kernel@vger.kernel.org
Cc: giancarlo.asnaghi@st.com, balbi@ti.com,
broonie@opensource.wolfsonmicro.com
Subject: [PATCH V2 2/2] usb: dwc3: use debugfs_print_regs32()
Date: Fri, 18 Nov 2011 14:51:43 +0100 [thread overview]
Message-ID: <20111118135143.GA1101@mail.gnudd.com> (raw)
In-Reply-To: 20111118002049.GA24806@mail.gnudd.com
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>
Cc: Felipe Balbi <balbi@ti.com>
---
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 da1ad77..d9e7a26 100644
--- a/drivers/usb/dwc3/debugfs.c
+++ b/drivers/usb/dwc3/debugfs.c
@@ -51,18 +51,13 @@
#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;
}
--
1.6.0.2
next prev parent reply other threads:[~2011-11-18 13:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-18 0:20 [PATCH V2 0/2] debugfs: a tool to print 32-bit registers Alessandro Rubini
2011-11-18 13:36 ` Felipe Balbi
2011-11-18 13:55 ` Alessandro Rubini
2011-11-18 13:50 ` [PATCH V2 1/2] debugfs: add tools to printk " Alessandro Rubini
2011-11-18 13:51 ` Alessandro Rubini [this message]
2011-11-18 18:31 ` [PATCH V2 2/2] usb: dwc3: use debugfs_print_regs32() Greg KH
2011-11-18 19:26 ` Felipe Balbi
2011-11-18 19:48 ` Greg KH
2011-11-18 22:53 ` [PATCH] usb: dwc3: fix a warning Alessandro Rubini
2011-11-18 22:53 ` [PATCH] debugfs: print_regs32: make regs array a const pointer Alessandro Rubini
2011-11-22 13:04 ` [PATCH V2 0/2] debugfs: a tool to print 32-bit registers Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111118135143.GA1101@mail.gnudd.com \
--to=rubini@gnudd.com \
--cc=balbi@ti.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=giancarlo.asnaghi@st.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox