diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2014-02-10 04:42:42 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-02-18 11:53:01 -0500 |
commit | 0a7b1f8a70a59fd8215a937f77da20e003b9fc49 (patch) | |
tree | 44b9cc188c036f0d12edbf25ada48bb8e47549dd /drivers/usb/gadget | |
parent | a7ecf0544f0fc710ba6e2ff751d328a4190c4a1f (diff) |
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: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/f_fs.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/u_fs.h | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 5bfacf8b9e6e..b65a5029deed 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
@@ -228,7 +228,7 @@ static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len) | |||
228 | } | 228 | } |
229 | 229 | ||
230 | ffs->setup_state = FFS_NO_SETUP; | 230 | ffs->setup_state = FFS_NO_SETUP; |
231 | return ffs->ep0req_status; | 231 | return req->status ? req->status : req->actual; |
232 | } | 232 | } |
233 | 233 | ||
234 | static int __ffs_ep0_stall(struct ffs_data *ffs) | 234 | 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 78263cc36df8..c39e805025b9 100644 --- a/drivers/usb/gadget/u_fs.h +++ b/drivers/usb/gadget/u_fs.h | |||
@@ -154,7 +154,6 @@ struct ffs_data { | |||
154 | */ | 154 | */ |
155 | struct usb_request *ep0req; /* P: mutex */ | 155 | struct usb_request *ep0req; /* P: mutex */ |
156 | struct completion ep0req_completion; /* P: mutex */ | 156 | struct completion ep0req_completion; /* P: mutex */ |
157 | int ep0req_status; /* P: mutex */ | ||
158 | 157 | ||
159 | /* reference counter */ | 158 | /* reference counter */ |
160 | atomic_t ref; | 159 | atomic_t ref; |