aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/f_fs.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-11-28 19:34:03 -0500
committerDave Airlie <airlied@redhat.com>2018-11-28 19:34:03 -0500
commit1ec28f8b8ada4e4f77d1af006a3a474f4f83b8e3 (patch)
tree2e810e02a66cdec0bc82a8555796b7083ad03416 /drivers/usb/gadget/function/f_fs.c
parent61647c77cb15354a329cbb36fe7a2253b36b51b1 (diff)
parent2e6e902d185027f8e3cb8b7305238f7e35d6a436 (diff)
Merge v4.20-rc4 into drm-next
Requested by Boris Brezillon for some vc4 fixes that are needed for future vc4 work. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/usb/gadget/function/f_fs.c')
-rw-r--r--drivers/usb/gadget/function/f_fs.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index 3ada83d81bda..31e8bf3578c8 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -215,7 +215,6 @@ struct ffs_io_data {
215 215
216 struct mm_struct *mm; 216 struct mm_struct *mm;
217 struct work_struct work; 217 struct work_struct work;
218 struct work_struct cancellation_work;
219 218
220 struct usb_ep *ep; 219 struct usb_ep *ep;
221 struct usb_request *req; 220 struct usb_request *req;
@@ -1073,31 +1072,22 @@ ffs_epfile_open(struct inode *inode, struct file *file)
1073 return 0; 1072 return 0;
1074} 1073}
1075 1074
1076static void ffs_aio_cancel_worker(struct work_struct *work)
1077{
1078 struct ffs_io_data *io_data = container_of(work, struct ffs_io_data,
1079 cancellation_work);
1080
1081 ENTER();
1082
1083 usb_ep_dequeue(io_data->ep, io_data->req);
1084}
1085
1086static int ffs_aio_cancel(struct kiocb *kiocb) 1075static int ffs_aio_cancel(struct kiocb *kiocb)
1087{ 1076{
1088 struct ffs_io_data *io_data = kiocb->private; 1077 struct ffs_io_data *io_data = kiocb->private;
1089 struct ffs_data *ffs = io_data->ffs; 1078 struct ffs_epfile *epfile = kiocb->ki_filp->private_data;
1090 int value; 1079 int value;
1091 1080
1092 ENTER(); 1081 ENTER();
1093 1082
1094 if (likely(io_data && io_data->ep && io_data->req)) { 1083 spin_lock_irq(&epfile->ffs->eps_lock);
1095 INIT_WORK(&io_data->cancellation_work, ffs_aio_cancel_worker); 1084
1096 queue_work(ffs->io_completion_wq, &io_data->cancellation_work); 1085 if (likely(io_data && io_data->ep && io_data->req))
1097 value = -EINPROGRESS; 1086 value = usb_ep_dequeue(io_data->ep, io_data->req);
1098 } else { 1087 else
1099 value = -EINVAL; 1088 value = -EINVAL;
1100 } 1089
1090 spin_unlock_irq(&epfile->ffs->eps_lock);
1101 1091
1102 return value; 1092 return value;
1103} 1093}