From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: Patch IMX audmux debugfs.
Date: Fri, 12 Nov 2010 08:17:06 +0100 [thread overview]
Message-ID: <20101112071706.GF6017@pengutronix.de> (raw)
In-Reply-To: <BLU0-SMTP84DA72E534B9B3F1DCEA5BB8320@phx.gbl>
On Thu, Nov 11, 2010 at 11:38:48AM -0500, Bill Pringlemeir wrote:
> On 10 Nov 2010, s.hauer at pengutronix.de wrote:
>
> > On Tue, Nov 09, 2010 at 06:11:12PM -0500, Bill Pringlemeir wrote:
>
> >> $ mount -t debugfs debugfs /sys/kernel/debug
> >> $ cd /sys/kernel/debug/audmux
> >> $ cat *
> >> [crashes when accessing ssi7]
>
> >> The index is one based, but the register map is zero based. So the
> >> ssi1 is actually sending info for ssi2. Also, the ssi7 touches
> >> non-existent data and can cause an exception (only registers sets 1-6
> >> exist).
>
> > I prefer passing (void *)(i - 1) here and skipping the first hunk.
> > Please add your Signed-off-by next time you send a patch.
>
> Something similar occured in to me after reading Sergei message. This
> patch treats i as the port instead of the file name. The file name is
> generated from audmux_port_string making the filenames and file
> content the same.
Ok, looks sensible to me. I added Mark Brown to Cc as he added the
debugfs support in the first place. Maybe he has some comment to add.
Sascha
>
> Signed-off-by: Bill Pringlemeir <bpringle@sympatico.ca>
> diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c
> index f9e7cdb..ac30fdc 100644
> --- a/arch/arm/plat-mxc/audmux-v2.c
> +++ b/arch/arm/plat-mxc/audmux-v2.c
> @@ -142,7 +142,6 @@ static const struct file_operations audmux_debugfs_fops = {
> static void audmux_debugfs_init(void)
> {
> int i;
> - char buf[20];
>
> audmux_debugfs_root = debugfs_create_dir("audmux", NULL);
> if (!audmux_debugfs_root) {
> @@ -150,9 +149,9 @@ static void audmux_debugfs_init(void)
> return;
> }
>
> - for (i = 1; i < 8; i++) {
> - snprintf(buf, sizeof(buf), "ssi%d", i);
> - if (!debugfs_create_file(buf, 0444, audmux_debugfs_root,
> + for (i = 0; i < 6; i++) {
> + if (!debugfs_create_file(audmux_port_string(i), 0444,
> + audmux_debugfs_root,
> (void *)i, &audmux_debugfs_fops))
> pr_warning("Failed to create AUDMUX port %d debugfs file\n",
> i);
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2010-11-12 7:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-09 23:11 Patch IMX audmux debugfs Bill Pringlemeir
2010-11-10 11:19 ` Sergei Shtylyov
2010-11-10 15:26 ` Sascha Hauer
2010-11-11 16:38 ` Bill Pringlemeir
2010-11-12 7:17 ` Sascha Hauer [this message]
2010-11-12 11:49 ` Mark Brown
2010-11-14 20:15 ` Bill Pringlemeir
[not found] ` <87oc9rk6fe.fsf@sympatico.ca>
2010-11-15 15:09 ` [Patch v3] Fix audmuxv2 debugfs indexing. [was: Patch IMX audmux debugfs.] Bill Pringlemeir
2010-11-15 15:30 ` Mark Brown
2010-11-15 15:53 ` [Patch v3] Fix audmuxv2 debugfs indexing Bill Pringlemeir
[not found] ` <87oc9qeg75.fsf@sympatico.ca>
2010-11-15 16:10 ` Bill Pringlemeir
2010-11-15 16:26 ` Mark Brown
2010-11-15 18:17 ` Bill Pringlemeir
[not found] ` <8762vy4fki.fsf@sympatico.ca>
2010-11-19 15:47 ` Bill Pringlemeir
[not found] ` <87r5ehuxh5.fsf@sympatico.ca>
2010-11-30 21:07 ` Bill Pringlemeir
[not found] ` <87zktavd2f.fsf_-_@sympatico.ca>
2010-11-15 15:24 ` Bill Pringlemeir
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=20101112071706.GF6017@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).