From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754250AbcHSTPE (ORCPT ); Fri, 19 Aug 2016 15:15:04 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:49932 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbcHSTPD (ORCPT ); Fri, 19 Aug 2016 15:15:03 -0400 Subject: Re: [PATCH v4 10/10] usb: gadget: f_hid: use alloc_ep_req() To: "Felipe F. Tonello" , "linux-usb@vger.kernel.org" References: <20160808203013.19283-1-eu@felipetonello.com> <20160808203013.19283-11-eu@felipetonello.com> CC: "linux-kernel@vger.kernel.org" , "Felipe Balbi" , Michal Nazarewicz From: John Youn Message-ID: <6a4fcb3c-7c75-257d-24d5-3c7b8e0f056f@synopsys.com> Date: Fri, 19 Aug 2016 12:07:00 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160808203013.19283-11-eu@felipetonello.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.9.136.108] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/8/2016 1:30 PM, Felipe F. Tonello wrote: > Use gadget's framework allocation function instead of directly calling > usb_ep_alloc_request(). > > Signed-off-by: Felipe F. Tonello > --- > drivers/usb/gadget/function/f_hid.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c > index a010496e4e05..89d2e9a5a04f 100644 > --- a/drivers/usb/gadget/function/f_hid.c > +++ b/drivers/usb/gadget/function/f_hid.c > @@ -611,14 +611,10 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f) > > /* preallocate request and buffer */ > status = -ENOMEM; > - hidg->req = usb_ep_alloc_request(hidg->in_ep, GFP_KERNEL); > + hidg->req = alloc_ep_req(hidg->in_ep, hidg->report_length); > if (!hidg->req) > goto fail; > > - hidg->req->buf = kmalloc(hidg->report_length, GFP_KERNEL); > - if (!hidg->req->buf) > - goto fail; > - > /* set descriptor dynamic values */ > hidg_interface_desc.bInterfaceSubClass = hidg->bInterfaceSubClass; > hidg_interface_desc.bInterfaceProtocol = hidg->bInterfaceProtocol; > Hi Felipe, This commit on your testing/next breaks compilation. ../drivers/usb/gadget/function/f_hid.c: In function ‘hidg_bind’: ../drivers/usb/gadget/function/f_hid.c:620:14: error: too few arguments to function ‘alloc_ep_req’ hidg->req = alloc_ep_req(hidg->in_ep, hidg->report_length); ^ In file included from ../drivers/usb/gadget/function/f_hid.c:24:0: ../drivers/usb/gadget/u_f.h:63:21: note: declared here struct usb_request *alloc_ep_req(struct usb_ep *ep, size_t len, int default_len); ^ Regards, John