summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-10-12 10:31:04 +0300
committerFelipe Balbi <balbi@ti.com>2011-12-12 11:48:11 +0200
commit9f622b2a407d8b34a5a7f5b4abd8b29b25cf4f32 (patch)
treea80c6f48a8f1c4fd70d0865b027035d3f8e0d44e /drivers/usb/dwc3/gadget.c
parent6c167fc9b0c23ead791edb94cf4debb6b8e534b5 (diff)
downloadlinux-9f622b2a407d8b34a5a7f5b4abd8b29b25cf4f32.tar.gz
linux-9f622b2a407d8b34a5a7f5b4abd8b29b25cf4f32.tar.bz2
linux-9f622b2a407d8b34a5a7f5b4abd8b29b25cf4f32.zip
usb: dwc3: calculate number of event buffers dynamically
This will allow us to only allocate memory when we actually need. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 807737aec00e..b84418e88774 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1925,7 +1925,7 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc)
spin_lock(&dwc->lock);
- for (i = 0; i < DWC3_EVENT_BUFFERS_NUM; i++) {
+ for (i = 0; i < dwc->num_event_buffers; i++) {
irqreturn_t status;
status = dwc3_process_event_buf(dwc, i);