aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2013-05-13 17:45:08 -0400
committerBenjamin LaHaise <bcrl@kvack.org>2013-07-30 11:53:11 -0400
commitbec68faaf3ba74ed0dcd5dc3a881b30aec542973 (patch)
treefc8704d99fea0108346de7c1ca2500ac7199f1ae /drivers/usb
parent723be6e39d14254bb5bb9f422b434566d359fa6e (diff)
aio: io_cancel() no longer returns the io_event
Originally, io_event() was documented to return the io_event if cancellation succeeded - the io_event wouldn't be delivered via the ring buffer like it normally would. But this isn't what the implementation was actually doing; the only driver implementing cancellation, the usb gadget code, never returned an io_event in its cancel function. And aio_complete() was recently changed to no longer suppress event delivery if the kiocb had been cancelled. This gets rid of the unused io_event argument to kiocb_cancel() and kiocb->ki_cancel(), and changes io_cancel() to return -EINPROGRESS if kiocb->ki_cancel() returned success. Also tweak the refcounting in kiocb_cancel() to make more sense. Signed-off-by: Kent Overstreet <koverstreet@google.com> Cc: Zach Brown <zab@redhat.com> Cc: Felipe Balbi <balbi@ti.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Jens Axboe <axboe@kernel.dk> Cc: Asai Thambi S P <asamymuthupa@micron.com> Cc: Selvan Mani <smani@micron.com> Cc: Sam Bradshaw <sbradshaw@micron.com> Cc: Jeff Moyer <jmoyer@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Benjamin LaHaise <bcrl@kvack.org> Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/inode.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 570c005062ab..e02c1e04529e 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -524,7 +524,7 @@ struct kiocb_priv {
524 unsigned actual; 524 unsigned actual;
525}; 525};
526 526
527static int ep_aio_cancel(struct kiocb *iocb, struct io_event *e) 527static int ep_aio_cancel(struct kiocb *iocb)
528{ 528{
529 struct kiocb_priv *priv = iocb->private; 529 struct kiocb_priv *priv = iocb->private;
530 struct ep_data *epdata; 530 struct ep_data *epdata;
@@ -540,7 +540,6 @@ static int ep_aio_cancel(struct kiocb *iocb, struct io_event *e)
540 // spin_unlock(&epdata->dev->lock); 540 // spin_unlock(&epdata->dev->lock);
541 local_irq_enable(); 541 local_irq_enable();
542 542
543 aio_put_req(iocb);
544 return value; 543 return value;
545} 544}
546 545