diff options
author | Armando Visconti <armando.visconti@st.com> | 2012-12-13 09:11:19 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-01-10 05:39:41 -0500 |
commit | 32c9cf22fccb371745bde98e1da1c3aeb4bb9f36 (patch) | |
tree | ad2fb88fdc5fb2d84c76dc21a0c91451a80ac661 /drivers/usb/gadget/f_sourcesink.c | |
parent | 8f900a9a6e2691441ad763952d640ac44220e5dc (diff) |
usb: gadget zero: avoid unnecessary reinit of data in f_sourcesink
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>
Diffstat (limited to 'drivers/usb/gadget/f_sourcesink.c')
-rw-r--r-- | drivers/usb/gadget/f_sourcesink.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_sourcesink.c b/drivers/usb/gadget/f_sourcesink.c index 102d49beb9df..de608864c6db 100644 --- a/drivers/usb/gadget/f_sourcesink.c +++ b/drivers/usb/gadget/f_sourcesink.c | |||
@@ -531,8 +531,7 @@ static void source_sink_complete(struct usb_ep *ep, struct usb_request *req) | |||
531 | check_read_data(ss, req); | 531 | check_read_data(ss, req); |
532 | if (pattern != 2) | 532 | if (pattern != 2) |
533 | memset(req->buf, 0x55, req->length); | 533 | memset(req->buf, 0x55, req->length); |
534 | } else | 534 | } |
535 | reinit_write_data(ep, req); | ||
536 | break; | 535 | break; |
537 | 536 | ||
538 | /* this endpoint is normally active while we're configured */ | 537 | /* this endpoint is normally active while we're configured */ |