Commit caefe6c7 authored by Felipe Balbi's avatar Felipe Balbi

usb: dwc3: gadget: use evt->length as we should

Instead of always accessing the macro directly,
let's rely on evt->length which is the actual length
of current event buffer. While unlikely, we could
change event buffer's size at any time.
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent d9fa4c63
...@@ -2834,7 +2834,7 @@ static irqreturn_t dwc3_process_event_buf(struct dwc3_event_buffer *evt) ...@@ -2834,7 +2834,7 @@ static irqreturn_t dwc3_process_event_buf(struct dwc3_event_buffer *evt)
* boundary so I worry about that once we try to handle * boundary so I worry about that once we try to handle
* that. * that.
*/ */
evt->lpos = (evt->lpos + 4) % DWC3_EVENT_BUFFERS_SIZE; evt->lpos = (evt->lpos + 4) % evt->length;
left -= 4; left -= 4;
dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), 4); dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), 4);
......
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