From: Greg KH <gregkh@linuxfoundation.org>
To: Felipe Balbi <balbi@ti.com>
Cc: Markus Pargmann <mpa@pengutronix.de>,
Bin Liu <binmlist@gmail.com>,
linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-omap@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH v4 1/2] usb: musb: dsps, debugfs files
Date: Tue, 18 Feb 2014 08:59:11 -0800 [thread overview]
Message-ID: <20140218165911.GA17486@kroah.com> (raw)
In-Reply-To: <20140218162054.GE9878@saruman.home>
On Tue, Feb 18, 2014 at 10:20:54AM -0600, Felipe Balbi wrote:
> On Fri, Jan 17, 2014 at 10:22:35AM +0100, Markus Pargmann wrote:
> > debugfs files to show the contents of important dsps registers.
> >
> > Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> > ---
> > drivers/usb/musb/musb_dsps.c | 54 ++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 54 insertions(+)
> >
> > diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
> > index 593d3c9..d0a97d6 100644
> > --- a/drivers/usb/musb/musb_dsps.c
> > +++ b/drivers/usb/musb/musb_dsps.c
> > @@ -46,6 +46,8 @@
> > #include <linux/of_irq.h>
> > #include <linux/usb/of.h>
> >
> > +#include <linux/debugfs.h>
> > +
> > #include "musb_core.h"
> >
> > static const struct of_device_id musb_dsps_of_match[];
> > @@ -137,6 +139,26 @@ struct dsps_glue {
> > unsigned long last_timer; /* last timer data for each instance */
> >
> > struct dsps_context context;
> > + struct debugfs_regset32 regset;
> > + struct dentry *dbgfs_root;
> > +};
> > +
> > +static const struct debugfs_reg32 dsps_musb_regs[] = {
> > + { "revision", 0x00 },
> > + { "control", 0x14 },
> > + { "status", 0x18 },
> > + { "eoi", 0x24 },
> > + { "intr0_stat", 0x30 },
> > + { "intr1_stat", 0x34 },
> > + { "intr0_set", 0x38 },
> > + { "intr1_set", 0x3c },
> > + { "txmode", 0x70 },
> > + { "rxmode", 0x74 },
> > + { "autoreq", 0xd0 },
> > + { "srpfixtime", 0xd4 },
> > + { "tdown", 0xd8 },
> > + { "phy_utmi", 0xe0 },
> > + { "mode", 0xe8 },
> > };
> >
> > static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout)
> > @@ -369,6 +391,30 @@ out:
> > return ret;
> > }
> >
> > +static int dsps_musb_dbg_init(struct musb *musb, struct dsps_glue *glue)
> > +{
> > + struct dentry *root;
> > + struct dentry *file;
> > + char buf[128];
> > +
> > + sprintf(buf, "%s.dsps", dev_name(musb->controller));
> > + root = debugfs_create_dir(buf, NULL);
> > + if (!root)
>
> wrong, you should be using IS_ERR()
!root is fine, IS_ERR() will fail if CONFIG_DEBUGFS is not enabled.
WARNING: multiple messages have this Message-ID (diff)
From: gregkh@linuxfoundation.org (Greg KH)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/2] usb: musb: dsps, debugfs files
Date: Tue, 18 Feb 2014 08:59:11 -0800 [thread overview]
Message-ID: <20140218165911.GA17486@kroah.com> (raw)
In-Reply-To: <20140218162054.GE9878@saruman.home>
On Tue, Feb 18, 2014 at 10:20:54AM -0600, Felipe Balbi wrote:
> On Fri, Jan 17, 2014 at 10:22:35AM +0100, Markus Pargmann wrote:
> > debugfs files to show the contents of important dsps registers.
> >
> > Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> > ---
> > drivers/usb/musb/musb_dsps.c | 54 ++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 54 insertions(+)
> >
> > diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
> > index 593d3c9..d0a97d6 100644
> > --- a/drivers/usb/musb/musb_dsps.c
> > +++ b/drivers/usb/musb/musb_dsps.c
> > @@ -46,6 +46,8 @@
> > #include <linux/of_irq.h>
> > #include <linux/usb/of.h>
> >
> > +#include <linux/debugfs.h>
> > +
> > #include "musb_core.h"
> >
> > static const struct of_device_id musb_dsps_of_match[];
> > @@ -137,6 +139,26 @@ struct dsps_glue {
> > unsigned long last_timer; /* last timer data for each instance */
> >
> > struct dsps_context context;
> > + struct debugfs_regset32 regset;
> > + struct dentry *dbgfs_root;
> > +};
> > +
> > +static const struct debugfs_reg32 dsps_musb_regs[] = {
> > + { "revision", 0x00 },
> > + { "control", 0x14 },
> > + { "status", 0x18 },
> > + { "eoi", 0x24 },
> > + { "intr0_stat", 0x30 },
> > + { "intr1_stat", 0x34 },
> > + { "intr0_set", 0x38 },
> > + { "intr1_set", 0x3c },
> > + { "txmode", 0x70 },
> > + { "rxmode", 0x74 },
> > + { "autoreq", 0xd0 },
> > + { "srpfixtime", 0xd4 },
> > + { "tdown", 0xd8 },
> > + { "phy_utmi", 0xe0 },
> > + { "mode", 0xe8 },
> > };
> >
> > static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout)
> > @@ -369,6 +391,30 @@ out:
> > return ret;
> > }
> >
> > +static int dsps_musb_dbg_init(struct musb *musb, struct dsps_glue *glue)
> > +{
> > + struct dentry *root;
> > + struct dentry *file;
> > + char buf[128];
> > +
> > + sprintf(buf, "%s.dsps", dev_name(musb->controller));
> > + root = debugfs_create_dir(buf, NULL);
> > + if (!root)
>
> wrong, you should be using IS_ERR()
!root is fine, IS_ERR() will fail if CONFIG_DEBUGFS is not enabled.
next prev parent reply other threads:[~2014-02-18 16:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-17 9:22 [PATCH v4 0/2] usb: musb dsps updates Markus Pargmann
2014-01-17 9:22 ` Markus Pargmann
[not found] ` <1389950556-6453-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2014-01-17 9:22 ` [PATCH v4 1/2] usb: musb: dsps, debugfs files Markus Pargmann
2014-01-17 9:22 ` Markus Pargmann
2014-02-18 16:20 ` Felipe Balbi
2014-02-18 16:20 ` Felipe Balbi
2014-02-18 16:59 ` Greg KH [this message]
2014-02-18 16:59 ` Greg KH
2014-02-18 17:03 ` Felipe Balbi
2014-02-18 17:03 ` Felipe Balbi
2014-02-18 17:30 ` Greg KH
2014-02-18 17:30 ` Greg KH
2014-02-18 17:50 ` Felipe Balbi
2014-02-18 17:50 ` Felipe Balbi
2014-02-16 22:03 ` [PATCH v4 0/2] usb: musb dsps updates Markus Pargmann
2014-02-16 22:03 ` Markus Pargmann
2014-01-17 9:22 ` [PATCH v4 2/2] usb: musb: dsps, use devm_kzalloc Markus Pargmann
2014-01-17 9:22 ` Markus Pargmann
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=20140218165911.GA17486@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=balbi@ti.com \
--cc=binmlist@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mpa@pengutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.