bool buf_done;
int ret;
- while (video->ep->enabled && uvc->state == UVC_STATE_STREAMING) {
+ if (video->ep->enabled && uvc->state == UVC_STATE_STREAMING) {
/*
* Retrieve the first available USB request, protected by the
* request lock.
}
req = list_first_entry(&video->req_free, struct usb_request,
list);
+ if (!req) {
+ spin_unlock_irqrestore(&video->req_lock, flags);
+ return;
+ }
+
list_del(&req->list);
spin_unlock_irqrestore(&video->req_lock, flags);
* further.
*/
spin_unlock_irqrestore(&queue->irqlock, flags);
- break;
+ goto out;
}
/*
/* Queue the USB request */
ret = uvcg_video_ep_queue(video, req);
spin_unlock_irqrestore(&queue->irqlock, flags);
-
if (ret < 0) {
uvcg_queue_cancel(queue, 0);
- break;
+ goto out;
}
/* Endpoint now owns the request */
req = NULL;
video->req_int_count++;
+ } else {
+ return;
}
- if (!req)
- return;
+ if (uvc->state == UVC_STATE_STREAMING)
+ queue_work(video->async_wq, &video->pump);
+ return;
+out:
spin_lock_irqsave(&video->req_lock, flags);
list_add_tail(&req->list, &video->req_free);
spin_unlock_irqrestore(&video->req_lock, flags);