Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303848
b: refs/heads/master
c: 3ef35fa
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi committed May 4, 2012
1 parent dbbbeab commit 90f0cae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f898ae09a043cf9c3c4be82c04e08fcf00fe82c1
refs/heads/master: 3ef35fafdc87b72851f7785dc5331a0f4eb1b3ce
1 change: 1 addition & 0 deletions trunk/drivers/usb/dwc3/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <linux/usb/gadget.h>

/* Global constants */
#define DWC3_EP0_BOUNCE_SIZE 512
#define DWC3_ENDPOINTS_NUM 32
#define DWC3_XHCI_RESOURCES_NUM 2

Expand Down
13 changes: 7 additions & 6 deletions trunk/drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -2319,15 +2319,16 @@ int __devinit dwc3_gadget_init(struct dwc3 *dwc)
goto err1;
}

dwc->setup_buf = kzalloc(512, GFP_KERNEL);
dwc->setup_buf = kzalloc(DWC3_EP0_BOUNCE_SIZE, GFP_KERNEL);
if (!dwc->setup_buf) {
dev_err(dwc->dev, "failed to allocate setup buffer\n");
ret = -ENOMEM;
goto err2;
}

dwc->ep0_bounce = dma_alloc_coherent(dwc->dev,
512, &dwc->ep0_bounce_addr, GFP_KERNEL);
DWC3_EP0_BOUNCE_SIZE, &dwc->ep0_bounce_addr,
GFP_KERNEL);
if (!dwc->ep0_bounce) {
dev_err(dwc->dev, "failed to allocate ep0 bounce buffer\n");
ret = -ENOMEM;
Expand Down Expand Up @@ -2414,8 +2415,8 @@ int __devinit dwc3_gadget_init(struct dwc3 *dwc)
dwc3_gadget_free_endpoints(dwc);

err4:
dma_free_coherent(dwc->dev, 512, dwc->ep0_bounce,
dwc->ep0_bounce_addr);
dma_free_coherent(dwc->dev, DWC3_EP0_BOUNCE_SIZE,
dwc->ep0_bounce, dwc->ep0_bounce_addr);

err3:
kfree(dwc->setup_buf);
Expand Down Expand Up @@ -2444,8 +2445,8 @@ void dwc3_gadget_exit(struct dwc3 *dwc)

dwc3_gadget_free_endpoints(dwc);

dma_free_coherent(dwc->dev, 512, dwc->ep0_bounce,
dwc->ep0_bounce_addr);
dma_free_coherent(dwc->dev, DWC3_EP0_BOUNCE_SIZE,
dwc->ep0_bounce, dwc->ep0_bounce_addr);

kfree(dwc->setup_buf);

Expand Down

0 comments on commit 90f0cae

Please sign in to comment.