diff options
author | Felipe F. Tonello <eu@felipetonello.com> | 2016-08-23 19:24:49 +0200 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-08-25 11:13:19 +0200 |
commit | aadbe812463f8af1751debb0eaaeec8a778d7ff1 (patch) | |
tree | 0ff2ceab225d50b36fa47e7c55f64c928d796e8d /drivers/usb/gadget/u_f.c | |
parent | usb: dwc3: Add ENDXFER command polling (diff) | |
download | linux-aadbe812463f8af1751debb0eaaeec8a778d7ff1.tar.xz linux-aadbe812463f8af1751debb0eaaeec8a778d7ff1.zip |
usb: gadget: remove useless parameter in alloc_ep_req()
The default_length parameter of alloc_ep_req was not really necessary
and gadget drivers would almost always create an inline function to pass
the same value to len and default_len.
This patch removes that parameter and updates all calls to alloc_ep_req() to
use the new API.
Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/u_f.c')
-rw-r--r-- | drivers/usb/gadget/u_f.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/gadget/u_f.c b/drivers/usb/gadget/u_f.c index 907f8144813c..18839732c840 100644 --- a/drivers/usb/gadget/u_f.c +++ b/drivers/usb/gadget/u_f.c @@ -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); |