Commit 0a7b1f8a authored by Robert Baldyga's avatar Robert Baldyga Committed by Felipe Balbi

usb: gadget: f_fs: fix setup request handling

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: default avatarRobert Baldyga <r.baldyga@samsung.com>
Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent a7ecf054
...@@ -228,7 +228,7 @@ static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len) ...@@ -228,7 +228,7 @@ static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len)
} }
ffs->setup_state = FFS_NO_SETUP; 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) static int __ffs_ep0_stall(struct ffs_data *ffs)
......
...@@ -154,7 +154,6 @@ struct ffs_data { ...@@ -154,7 +154,6 @@ struct ffs_data {
*/ */
struct usb_request *ep0req; /* P: mutex */ struct usb_request *ep0req; /* P: mutex */
struct completion ep0req_completion; /* P: mutex */ struct completion ep0req_completion; /* P: mutex */
int ep0req_status; /* P: mutex */
/* reference counter */ /* reference counter */
atomic_t ref; atomic_t ref;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment