On Fri, Mar 27, 2015 at 05:07:59PM +0800, Peter Chen wrote:
> On Fri, Mar 27, 2015 at 03:06:27PM +0800, Li Jun wrote:
> > Since the required clock to access registers is gated off in low power mode,
> > add ci->in_lpm check before try to dump registers value.
> > 
> > Signed-off-by: Li Jun <jun...@freescale.com>
> > ---
> >  drivers/usb/chipidea/debug.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
> > index 268e423..a367cee 100644
> > --- a/drivers/usb/chipidea/debug.c
> > +++ b/drivers/usb/chipidea/debug.c
> > @@ -339,6 +339,11 @@ static int ci_registers_show(struct seq_file *s, void 
> > *unused)
> >     if (!ci)
> >             return 0;
> >  
> > +   if (ci->in_lpm) {
> > +           seq_printf(s, "Can't dump registers value in low power mode\n");
> > +           return 0;
> > +   }
> > +
> >     /* ------ Registers ----- */
> >     tmp_reg = hw_read_intr_enable(ci);
> >     seq_printf(s, "USBINTR reg: %08x\n", tmp_reg);
> > -- 
> > 1.9.1
> > 
> 
> Why not just return error code, it will show warning message too.
> 
Since this is debug only purpose code, compare just say this operation is not
allowed, I thought a specific message to tell debugger usb is in low power mode
may be more readable, if you prefer a simple return with -EPERM, I am also glad
take it:)

Li Jun
> -- 
> 
> Best Regards,
> Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to