@@ -892,30 +892,6 @@ static struct tty_driver *gs_tty_driver;
static struct gscons_info gscons_info;
static struct console gserial_cons;
-static struct usb_request *gs_request_new(struct usb_ep *ep)
-{
- struct usb_request *req = usb_ep_alloc_request(ep, GFP_ATOMIC);
- if (!req)
- return NULL;
-
- req->buf = kmalloc(ep->maxpacket, GFP_ATOMIC);
- if (!req->buf) {
- usb_ep_free_request(ep, req);
- return NULL;
- }
-
- return req;
-}
-
-static void gs_request_free(struct usb_request *req, struct usb_ep *ep)
-{
- if (!req)
- return;
-
- kfree(req->buf);
- usb_ep_free_request(ep, req);
-}
-
static void gs_complete_out(struct usb_ep *ep, struct usb_request *req)
{
struct gscons_info *info = &gscons_info;
@@ -955,7 +931,7 @@ static int gs_console_connect(int port_num)
port = ports[port_num].port;
ep = port->port_usb->in;
if (!info->console_req) {
- info->console_req = gs_request_new(ep);
+ info->console_req = gs_alloc_req(ep, ep->maxpacket, GFP_ATOMIC);
if (!info->console_req)
return -ENOMEM;
info->console_req->complete = gs_complete_out;
@@ -974,7 +950,7 @@ static void gs_console_disconnect(struct usb_ep *ep)
struct gscons_info *info = &gscons_info;
struct usb_request *req = info->console_req;
- gs_request_free(req, ep);
+ gs_free_req(ep, req);
info->console_req = NULL;
}
Driver already contains request allocation and deallocation functions, so use them also for console_req. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> --- Changes: - v2: Move locking changes into separate patch drivers/usb/gadget/function/u_serial.c | 28 ++------------------------ 1 file changed, 2 insertions(+), 26 deletions(-)