Commit 7037e101 authored by John Keeping's avatar John Keeping Committed by Greg Kroah-Hartman

usb: dwc2: fix debugfs FIFO count

The number of FIFOs may be lower than the number of endpoints.  Use the
correct total when printing FIFO details in debugfs.
Acked-by: default avatarMinas Harutyunyan <hminas@synopsys.com>
Signed-off-by: default avatarJohn Keeping <john@metanate.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 644139f8
...@@ -183,6 +183,7 @@ DEFINE_SHOW_ATTRIBUTE(state); ...@@ -183,6 +183,7 @@ DEFINE_SHOW_ATTRIBUTE(state);
static int fifo_show(struct seq_file *seq, void *v) static int fifo_show(struct seq_file *seq, void *v)
{ {
struct dwc2_hsotg *hsotg = seq->private; struct dwc2_hsotg *hsotg = seq->private;
int fifo_count = dwc2_hsotg_tx_fifo_count(hsotg);
u32 val; u32 val;
int idx; int idx;
...@@ -196,7 +197,7 @@ static int fifo_show(struct seq_file *seq, void *v) ...@@ -196,7 +197,7 @@ static int fifo_show(struct seq_file *seq, void *v)
seq_puts(seq, "\nPeriodic TXFIFOs:\n"); 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)); val = dwc2_readl(hsotg, DPTXFSIZN(idx));
seq_printf(seq, "\tDPTXFIFO%2d: Size %d, Start 0x%08x\n", idx, seq_printf(seq, "\tDPTXFIFO%2d: Size %d, Start 0x%08x\n", idx,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment