summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMian Yousaf Kaukab <yousaf.kaukab@intel.com>2015-01-09 13:38:55 +0100
committerFelipe Balbi <balbi@ti.com>2015-01-12 15:33:43 -0600
commit364f8e933869699167db935e13b41b1d92ab369d (patch)
tree9116f8f46e6d25bc8d455534cb9f54b96b289bdb /drivers
parentea5a8774a273c62047abb3cb5cca69c8368d05da (diff)
downloadlinux-364f8e933869699167db935e13b41b1d92ab369d.tar.bz2
usb: dwc2: gadget: fix debug loop limits
< 15 check doesn't show debug information for endpoint 15. It is possible to have less than 15 endpoints so use limit provided by hardware configuration. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc2/gadget.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index c43ce7e8809a..7dfda954aba1 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3156,14 +3156,14 @@ static void s3c_hsotg_dump(struct dwc2_hsotg *hsotg)
/* show periodic fifo settings */
- for (idx = 1; idx <= 15; idx++) {
+ for (idx = 1; idx < hsotg->num_of_eps; idx++) {
val = readl(regs + DPTXFSIZN(idx));
dev_info(dev, "DPTx[%d] FSize=%d, StAddr=0x%08x\n", idx,
val >> FIFOSIZE_DEPTH_SHIFT,
val & FIFOSIZE_STARTADDR_MASK);
}
- for (idx = 0; idx < 15; idx++) {
+ for (idx = 0; idx < hsotg->num_of_eps; idx++) {
dev_info(dev,
"ep%d-in: EPCTL=0x%08x, SIZ=0x%08x, DMA=0x%08x\n", idx,
readl(regs + DIEPCTL(idx)),
@@ -3221,7 +3221,7 @@ static int state_show(struct seq_file *seq, void *v)
seq_puts(seq, "\nEndpoint status:\n");
- for (idx = 0; idx < 15; idx++) {
+ for (idx = 0; idx < hsotg->num_of_eps; idx++) {
u32 in, out;
in = readl(regs + DIEPCTL(idx));
@@ -3280,7 +3280,7 @@ static int fifo_show(struct seq_file *seq, void *v)
seq_puts(seq, "\nPeriodic TXFIFOs:\n");
- for (idx = 1; idx <= 15; idx++) {
+ for (idx = 1; idx < hsotg->num_of_eps; idx++) {
val = readl(regs + DPTXFSIZN(idx));
seq_printf(seq, "\tDPTXFIFO%2d: Size %d, Start 0x%08x\n", idx,