Re: [PATCH v2 1/3] usb: gadget: f_fs: fix setup request handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 17 2014, Robert Baldyga <r.baldyga@xxxxxxxxxxx> wrote:
> This patch fixes __ffs_ep0_queue_wait() function, which now returns number of
> bytes transferred in USB request or error code in case of failure. This is
> needed by ffs_ep0_read() function, when read data is copied to userspace.
>
> It also cleans up code by removing usused variable ep0req_status.
>
> Signed-off-by: Robert Baldyga <r.baldyga@xxxxxxxxxxx>

Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

Good catch, thanks.

> ---
>  drivers/usb/gadget/f_fs.c |    2 +-
>  drivers/usb/gadget/u_fs.h |    1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
> index 306a2b5..44a6bbe 100644
> --- a/drivers/usb/gadget/f_fs.c
> +++ b/drivers/usb/gadget/f_fs.c
> @@ -218,7 +218,7 @@ static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len)
>  	}
>  
>  	ffs->setup_state = FFS_NO_SETUP;
> -	return ffs->ep0req_status;
> +	return req->status ? req->status : req->actual;
>  }
>  
>  static int __ffs_ep0_stall(struct ffs_data *ffs)
> diff --git a/drivers/usb/gadget/u_fs.h b/drivers/usb/gadget/u_fs.h
> index bc2d371..55d2f2e 100644
> --- a/drivers/usb/gadget/u_fs.h
> +++ b/drivers/usb/gadget/u_fs.h
> @@ -156,7 +156,6 @@ struct ffs_data {
>  	 */
>  	struct usb_request		*ep0req;		/* P: mutex */
>  	struct completion		ep0req_completion;	/* P: mutex */
> -	int				ep0req_status;		/* P: mutex */
>  
>  	/* reference counter */
>  	atomic_t			ref;
> -- 
> 1.7.9.5
>

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@xxxxxxxxxx>--<xmpp:mina86@xxxxxxxxxx>--ooO--(_)--Ooo--

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux