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>
		
			
				
	
	
		
			34 lines
		
	
	
		
			842 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			842 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * u_f.c -- USB function utilities for Gadget stack
 | |
|  *
 | |
|  * Copyright (c) 2013 Samsung Electronics Co., Ltd.
 | |
|  *		http://www.samsung.com
 | |
|  *
 | |
|  * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
 | |
|  *
 | |
|  * This program is free software; you can redistribute it and/or modify
 | |
|  * it under the terms of the GNU General Public License version 2 as
 | |
|  * published by the Free Software Foundation.
 | |
|  */
 | |
| 
 | |
| #include "u_f.h"
 | |
| #include <linux/usb/ch9.h>
 | |
| 
 | |
| 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 = 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);
 | |
| 			req = NULL;
 | |
| 		}
 | |
| 	}
 | |
| 	return req;
 | |
| }
 | |
| EXPORT_SYMBOL_GPL(alloc_ep_req);
 |