diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2015-03-03 11:39:34 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-03-08 20:33:50 +0300 |
commit | d4461a602cf39c59f32817162539f4e723621865 (patch) | |
tree | 137d043fa8a0be030396b321e54be8d19135c174 /drivers/usb/misc/usb_u132.h | |
parent | 7fe3976e0f3ab26f8ffd9430d3d2a19a70f2c8d2 (diff) | |
download | linux-d4461a602cf39c59f32817162539f4e723621865.tar.xz |
gadgetfs: get rid of flipping ->f_op in ep_config()
Final methods start with get_ready_ep(), which will fail unless we have
->state == STATE_EP_ENABLED. So they'd be failing just fine until that
first write() anyway. Let's do the following:
* get_ready_ep() gets a new argument - true when called from
ep_write_iter(), false otherwise.
* make it quiet when it finds STATE_EP_READY (no printk, that is;
the case won't be impossible after that change).
* when that new argument is true, treat STATE_EP_READY the same
way as STATE_EP_ENABLED (i.e. return zero and do not unlock).
* in ep_write_iter(), after success of get_ready_ep() turn
if (!usb_endpoint_dir_in(&epdata->desc)) {
into
if (epdata->state == STATE_EP_ENABLED &&
!usb_endpoint_dir_in(&epdata->desc)) {
- that logics only applies after config.
* have ep_config() take kernel-side buffer (i.e. use memcpy()
instead of copy_from_user() in there) and in the "let's call ep_io or
ep_aio" (again, in ep_write_iter()) add "... or ep_config() in case it's
not configured yet"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/usb/misc/usb_u132.h')
0 files changed, 0 insertions, 0 deletions