Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322729
b: refs/heads/master
c: ad6b1b9
h: refs/heads/master
i:
  322727: aa5308a
v: v3
  • Loading branch information
Marc Kleine-Budde authored and Greg Kroah-Hartman committed Sep 12, 2012
1 parent 2aa2394 commit a718b24
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 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: c9d1f947a85e38b6dded469470c95ed62430cb3f
refs/heads/master: ad6b1b97fe8504957d017cd6e4168cac8903d3f3
23 changes: 15 additions & 8 deletions trunk/drivers/usb/chipidea/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,17 @@ static int init_eps(struct ci13xxx *ci)
return retval;
}

static void destroy_eps(struct ci13xxx *ci)
{
int i;

for (i = 0; i < ci->hw_ep_max; i++) {
struct ci13xxx_ep *mEp = &ci->ci13xxx_ep[i];

dma_pool_free(ci->qh_pool, mEp->qh.ptr, mEp->qh.dma);
}
}

/**
* ci13xxx_start: register a gadget driver
* @gadget: our gadget
Expand Down Expand Up @@ -1710,7 +1721,7 @@ static int udc_start(struct ci13xxx *ci)
if (ci->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) {
if (ci->transceiver == NULL) {
retval = -ENODEV;
goto free_pools;
goto destroy_eps;
}
}

Expand Down Expand Up @@ -1761,6 +1772,8 @@ static int udc_start(struct ci13xxx *ci)
put_transceiver:
if (!IS_ERR_OR_NULL(ci->transceiver) && ci->global_phy)
usb_put_phy(ci->transceiver);
destroy_eps:
destroy_eps(ci);
free_pools:
dma_pool_destroy(ci->td_pool);
free_qh_pool:
Expand All @@ -1775,18 +1788,12 @@ static int udc_start(struct ci13xxx *ci)
*/
static void udc_stop(struct ci13xxx *ci)
{
int i;

if (ci == NULL)
return;

usb_del_gadget_udc(&ci->gadget);

for (i = 0; i < ci->hw_ep_max; i++) {
struct ci13xxx_ep *mEp = &ci->ci13xxx_ep[i];

dma_pool_free(ci->qh_pool, mEp->qh.ptr, mEp->qh.dma);
}
destroy_eps(ci);

dma_pool_destroy(ci->td_pool);
dma_pool_destroy(ci->qh_pool);
Expand Down

0 comments on commit a718b24

Please sign in to comment.