Skip to content

Commit

Permalink
usb: gadget zero: avoid unnecessary reinit of data in f_sourcesink
Browse files Browse the repository at this point in the history
In the IN case, since the USB request is allocated only when
the source/sink function is started and never freed, the USB ept
buffer needs to be initialized only at the beginning. This change
results into a more performant g_zero module, especially when
'pattern=1' is selected.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Armando Visconti authored and Felipe Balbi committed Jan 10, 2013
1 parent 8f900a9 commit 32c9cf2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/gadget/f_sourcesink.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,7 @@ static void source_sink_complete(struct usb_ep *ep, struct usb_request *req)
check_read_data(ss, req);
if (pattern != 2)
memset(req->buf, 0x55, req->length);
} else
reinit_write_data(ep, req);
}
break;

/* this endpoint is normally active while we're configured */
Expand Down

0 comments on commit 32c9cf2

Please sign in to comment.