Merge branch 'for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
[deliverable/linux.git] / drivers / usb / gadget / u_f.c
CommitLineData
1efd54ea
AP
1/*
2 * u_f.c -- USB function utilities for Gadget stack
3 *
4 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 *
7 * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/usb/gadget.h>
15#include "u_f.h"
16
17struct usb_request *alloc_ep_req(struct usb_ep *ep, int len, int default_len)
18{
19 struct usb_request *req;
20
21 req = usb_ep_alloc_request(ep, GFP_ATOMIC);
22 if (req) {
23 req->length = len ?: default_len;
24 req->buf = kmalloc(req->length, GFP_ATOMIC);
25 if (!req->buf) {
26 usb_ep_free_request(ep, req);
27 req = NULL;
28 }
29 }
30 return req;
31}
0700faaf 32EXPORT_SYMBOL_GPL(alloc_ep_req);
This page took 0.145723 seconds and 5 git commands to generate.