Loading drivers/usb/gadget/function/f_hid.c +4 −8 Original line number Diff line number Diff line Loading @@ -377,7 +377,7 @@ static int f_hidg_open(struct inode *inode, struct file *fd) static inline struct usb_request *hidg_alloc_ep_req(struct usb_ep *ep, unsigned length) { return alloc_ep_req(ep, length, length); return alloc_ep_req(ep, length); } static void hidg_set_report_complete(struct usb_ep *ep, struct usb_request *req) Loading Loading @@ -693,11 +693,8 @@ fail_free_descs: usb_free_all_descriptors(f); fail: ERROR(f->config->cdev, "hidg_bind FAILED\n"); if (hidg->req != NULL) { kfree(hidg->req->buf); if (hidg->in_ep != NULL) usb_ep_free_request(hidg->in_ep, hidg->req); } if (hidg->req != NULL) free_ep_req(hidg->in_ep, hidg->req); return status; } Loading Loading @@ -936,8 +933,7 @@ static void hidg_unbind(struct usb_configuration *c, struct usb_function *f) /* disable/free request and end point */ usb_ep_disable(hidg->in_ep); kfree(hidg->req->buf); usb_ep_free_request(hidg->in_ep, hidg->req); free_ep_req(hidg->in_ep, hidg->req); usb_free_all_descriptors(f); } Loading drivers/usb/gadget/function/f_loopback.c +2 −4 Original line number Diff line number Diff line Loading @@ -308,9 +308,7 @@ static void disable_loopback(struct f_loopback *loop) static inline struct usb_request *lb_alloc_ep_req(struct usb_ep *ep, int len) { struct f_loopback *loop = ep->driver_data; return alloc_ep_req(ep, len, loop->buflen); return alloc_ep_req(ep, len); } static int alloc_requests(struct usb_composite_dev *cdev, Loading @@ -333,7 +331,7 @@ static int alloc_requests(struct usb_composite_dev *cdev, if (!in_req) goto fail; out_req = lb_alloc_ep_req(loop->out_ep, 0); out_req = lb_alloc_ep_req(loop->out_ep, loop->buflen); if (!out_req) goto fail_in; Loading drivers/usb/gadget/function/f_midi.c +1 −1 Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ static struct usb_gadget_strings *midi_strings[] = { static inline struct usb_request *midi_alloc_ep_req(struct usb_ep *ep, unsigned length) { return alloc_ep_req(ep, length, length); return alloc_ep_req(ep, length); } static const uint8_t f_midi_cin_length[] = { Loading drivers/usb/gadget/function/f_sourcesink.c +2 −4 Original line number Diff line number Diff line Loading @@ -298,9 +298,7 @@ static struct usb_gadget_strings *sourcesink_strings[] = { static inline struct usb_request *ss_alloc_ep_req(struct usb_ep *ep, int len) { struct f_sourcesink *ss = ep->driver_data; return alloc_ep_req(ep, len, ss->buflen); return alloc_ep_req(ep, len); } static void disable_ep(struct usb_composite_dev *cdev, struct usb_ep *ep) Loading Loading @@ -611,7 +609,7 @@ static int source_sink_start_ep(struct f_sourcesink *ss, bool is_in, req = ss_alloc_ep_req(ep, size); } else { ep = is_in ? ss->in_ep : ss->out_ep; req = ss_alloc_ep_req(ep, 0); req = ss_alloc_ep_req(ep, ss->buflen); } if (!req) Loading drivers/usb/gadget/u_f.c +3 −4 Original line number Diff line number Diff line Loading @@ -14,15 +14,14 @@ #include "u_f.h" #include <linux/usb/ch9.h> struct usb_request *alloc_ep_req(struct usb_ep *ep, size_t len, int default_len) struct usb_request *alloc_ep_req(struct usb_ep *ep, size_t len) { struct usb_request *req; req = usb_ep_alloc_request(ep, GFP_ATOMIC); if (req) { req->length = len ?: default_len; if (usb_endpoint_dir_out(ep->desc)) req->length = usb_ep_align(ep, req->length); req->length = usb_endpoint_dir_out(ep->desc) ? usb_ep_align(ep, len) : len; req->buf = kmalloc(req->length, GFP_ATOMIC); if (!req->buf) { usb_ep_free_request(ep, req); Loading Loading
drivers/usb/gadget/function/f_hid.c +4 −8 Original line number Diff line number Diff line Loading @@ -377,7 +377,7 @@ static int f_hidg_open(struct inode *inode, struct file *fd) static inline struct usb_request *hidg_alloc_ep_req(struct usb_ep *ep, unsigned length) { return alloc_ep_req(ep, length, length); return alloc_ep_req(ep, length); } static void hidg_set_report_complete(struct usb_ep *ep, struct usb_request *req) Loading Loading @@ -693,11 +693,8 @@ fail_free_descs: usb_free_all_descriptors(f); fail: ERROR(f->config->cdev, "hidg_bind FAILED\n"); if (hidg->req != NULL) { kfree(hidg->req->buf); if (hidg->in_ep != NULL) usb_ep_free_request(hidg->in_ep, hidg->req); } if (hidg->req != NULL) free_ep_req(hidg->in_ep, hidg->req); return status; } Loading Loading @@ -936,8 +933,7 @@ static void hidg_unbind(struct usb_configuration *c, struct usb_function *f) /* disable/free request and end point */ usb_ep_disable(hidg->in_ep); kfree(hidg->req->buf); usb_ep_free_request(hidg->in_ep, hidg->req); free_ep_req(hidg->in_ep, hidg->req); usb_free_all_descriptors(f); } Loading
drivers/usb/gadget/function/f_loopback.c +2 −4 Original line number Diff line number Diff line Loading @@ -308,9 +308,7 @@ static void disable_loopback(struct f_loopback *loop) static inline struct usb_request *lb_alloc_ep_req(struct usb_ep *ep, int len) { struct f_loopback *loop = ep->driver_data; return alloc_ep_req(ep, len, loop->buflen); return alloc_ep_req(ep, len); } static int alloc_requests(struct usb_composite_dev *cdev, Loading @@ -333,7 +331,7 @@ static int alloc_requests(struct usb_composite_dev *cdev, if (!in_req) goto fail; out_req = lb_alloc_ep_req(loop->out_ep, 0); out_req = lb_alloc_ep_req(loop->out_ep, loop->buflen); if (!out_req) goto fail_in; Loading
drivers/usb/gadget/function/f_midi.c +1 −1 Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ static struct usb_gadget_strings *midi_strings[] = { static inline struct usb_request *midi_alloc_ep_req(struct usb_ep *ep, unsigned length) { return alloc_ep_req(ep, length, length); return alloc_ep_req(ep, length); } static const uint8_t f_midi_cin_length[] = { Loading
drivers/usb/gadget/function/f_sourcesink.c +2 −4 Original line number Diff line number Diff line Loading @@ -298,9 +298,7 @@ static struct usb_gadget_strings *sourcesink_strings[] = { static inline struct usb_request *ss_alloc_ep_req(struct usb_ep *ep, int len) { struct f_sourcesink *ss = ep->driver_data; return alloc_ep_req(ep, len, ss->buflen); return alloc_ep_req(ep, len); } static void disable_ep(struct usb_composite_dev *cdev, struct usb_ep *ep) Loading Loading @@ -611,7 +609,7 @@ static int source_sink_start_ep(struct f_sourcesink *ss, bool is_in, req = ss_alloc_ep_req(ep, size); } else { ep = is_in ? ss->in_ep : ss->out_ep; req = ss_alloc_ep_req(ep, 0); req = ss_alloc_ep_req(ep, ss->buflen); } if (!req) Loading
drivers/usb/gadget/u_f.c +3 −4 Original line number Diff line number Diff line Loading @@ -14,15 +14,14 @@ #include "u_f.h" #include <linux/usb/ch9.h> struct usb_request *alloc_ep_req(struct usb_ep *ep, size_t len, int default_len) struct usb_request *alloc_ep_req(struct usb_ep *ep, size_t len) { struct usb_request *req; req = usb_ep_alloc_request(ep, GFP_ATOMIC); if (req) { req->length = len ?: default_len; if (usb_endpoint_dir_out(ep->desc)) req->length = usb_ep_align(ep, req->length); req->length = usb_endpoint_dir_out(ep->desc) ? usb_ep_align(ep, len) : len; req->buf = kmalloc(req->length, GFP_ATOMIC); if (!req->buf) { usb_ep_free_request(ep, req); Loading