diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-10-30 06:12:50 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-10-30 06:12:50 +0100 |
commit | fe0f59c41255d339f4f059be62c350c3c48a3f95 (patch) | |
tree | fde2381bf94a14ea1553f88f9e9e37b45ed280dc /drivers/usb/gadget/u_f.c | |
parent | cpufreq: intel_pstate: Always set max P-state in performance mode (diff) | |
parent | Documentation: intel_pstate: PID tuning is not always available (diff) | |
download | linux-fe0f59c41255d339f4f059be62c350c3c48a3f95.tar.xz linux-fe0f59c41255d339f4f059be62c350c3c48a3f95.zip |
Merge back earlier cpufreq material for v4.10.
Diffstat (limited to 'drivers/usb/gadget/u_f.c')
-rw-r--r-- | drivers/usb/gadget/u_f.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/gadget/u_f.c b/drivers/usb/gadget/u_f.c index 4bc7eea8bfc8..18839732c840 100644 --- a/drivers/usb/gadget/u_f.c +++ b/drivers/usb/gadget/u_f.c @@ -12,14 +12,16 @@ */ #include "u_f.h" +#include <linux/usb/ch9.h> -struct usb_request *alloc_ep_req(struct usb_ep *ep, int 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; + 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); |