usb: chipidea: debug: add low power mode check before print registers
authorLi Jun <jun.li@freescale.com>
Fri, 27 Mar 2015 11:43:01 +0000 (19:43 +0800)
committerPeter Chen <peter.chen@freescale.com>
Wed, 8 Apr 2015 06:32:00 +0000 (14:32 +0800)
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.li@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/chipidea/debug.c

index 268e4236e84cfd51ecd9748af71fc772f196666b..dfb05edcdb96dbbb3b794d6faf5c799b3c031f06 100644 (file)
@@ -336,8 +336,8 @@ static int ci_registers_show(struct seq_file *s, void *unused)
        struct ci_hdrc *ci = s->private;
        u32 tmp_reg;
 
-       if (!ci)
-               return 0;
+       if (!ci || ci->in_lpm)
+               return -EPERM;
 
        /* ------ Registers ----- */
        tmp_reg = hw_read_intr_enable(ci);