]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: dwc2: fix debugfs FIFO count
authorJohn Keeping <john@metanate.com>
Thu, 19 Dec 2019 11:34:32 +0000 (11:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Jan 2020 09:39:21 +0000 (10:39 +0100)
The number of FIFOs may be lower than the number of endpoints.  Use the
correct total when printing FIFO details in debugfs.

Acked-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/debugfs.c

index b8f2790abf91f749d7524764364d384c90628887..3a0dcbfbc82721f0823acfa1b57298d3c67c5ac9 100644 (file)
@@ -183,6 +183,7 @@ DEFINE_SHOW_ATTRIBUTE(state);
 static int fifo_show(struct seq_file *seq, void *v)
 {
        struct dwc2_hsotg *hsotg = seq->private;
+       int fifo_count = dwc2_hsotg_tx_fifo_count(hsotg);
        u32 val;
        int idx;
 
@@ -196,7 +197,7 @@ static int fifo_show(struct seq_file *seq, void *v)
 
        seq_puts(seq, "\nPeriodic TXFIFOs:\n");
 
-       for (idx = 1; idx < hsotg->num_of_eps; idx++) {
+       for (idx = 1; idx <= fifo_count; idx++) {
                val = dwc2_readl(hsotg, DPTXFSIZN(idx));
 
                seq_printf(seq, "\tDPTXFIFO%2d: Size %d, Start 0x%08x\n", idx,