summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Baldyga <r.baldyga@samsung.com>2016-08-29 13:38:50 -0700
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-08-31 10:06:05 +0300
commitad674a15249e7d800162858e49272877a782ec40 (patch)
tree24376bb4d99f581756930c0b2b1be19ee1ad9121
parentda7b895d518cc1753ee5f4b7f2158087282d1a65 (diff)
downloadlinux-stable-ad674a15249e7d800162858e49272877a782ec40.tar.gz
linux-stable-ad674a15249e7d800162858e49272877a782ec40.tar.bz2
linux-stable-ad674a15249e7d800162858e49272877a782ec40.zip
usb: dwc2: gadget: use ep->fifo_index in context of FIFO registers
In context of FIFO registers we use ep->fifo_index instead of ep->index. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r--drivers/usb/dwc2/gadget.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 2ff03ae08e14..eae908951eab 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -388,7 +388,8 @@ static int dwc2_hsotg_write_fifo(struct dwc2_hsotg *hsotg,
return -ENOSPC;
}
} else if (hsotg->dedicated_fifos && hs_ep->index != 0) {
- can_write = dwc2_readl(hsotg->regs + DTXFSTS(hs_ep->index));
+ can_write = dwc2_readl(hsotg->regs +
+ DTXFSTS(hs_ep->fifo_index));
can_write &= 0xffff;
can_write *= 4;
@@ -2432,7 +2433,7 @@ static void kill_all_requests(struct dwc2_hsotg *hsotg,
if (!hsotg->dedicated_fifos)
return;
- size = (dwc2_readl(hsotg->regs + DTXFSTS(ep->index)) & 0xffff) * 4;
+ size = (dwc2_readl(hsotg->regs + DTXFSTS(ep->fifo_index)) & 0xffff) * 4;
if (size < ep->fifo_size)
dwc2_hsotg_txfifo_flush(hsotg, ep->fifo_index);
}