Skip to content

Commit

Permalink
usb: gadget: f_fs: fix setup request handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Baldyga authored and Felipe Balbi committed Feb 18, 2014
1 parent a7ecf05 commit 0a7b1f8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/f_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
return ffs->ep0req_status;
return req->status ? req->status : req->actual;
}

static int __ffs_ep0_stall(struct ffs_data *ffs)
Expand Down
1 change: 0 additions & 1 deletion drivers/usb/gadget/u_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,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;
Expand Down

0 comments on commit 0a7b1f8

Please sign in to comment.