Skip to content

Commit

Permalink
usb: gadget: mv_udc: optimize ep_enable
Browse files Browse the repository at this point in the history
Only get head if not ep0.

Signed-off-by: Troy Kisky <[email protected]>
  • Loading branch information
tkisky authored and Marek Vasut committed Oct 20, 2013
1 parent 1ebf027 commit 7b7924c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/gadget/mv_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,8 @@ static void mv_ep_free_request(struct usb_ep *ep, struct usb_request *_req)

static void ep_enable(int num, int in, int maxpacket)
{
struct ept_queue_head *head;
struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor;
unsigned n;
head = mv_get_qh(num, in);

n = readl(&udc->epctrl[num]);
if (in)
Expand All @@ -222,6 +220,8 @@ static void ep_enable(int num, int in, int maxpacket)
n |= (CTRL_RXE | CTRL_RXR | CTRL_RXT_BULK);

if (num != 0) {
struct ept_queue_head *head = mv_get_qh(num, in);

head->config = CONFIG_MAX_PKT(maxpacket) | CONFIG_ZLT;
mv_flush_qh(num);
}
Expand Down

0 comments on commit 7b7924c

Please sign in to comment.