Skip to content

Commit

Permalink
usb: gadget: uvc: Simplify uvcg_video_pump by using local variable
Browse files Browse the repository at this point in the history
Use the local queue variable instead of computing it every time.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Laurent Pinchart authored and Felipe Balbi committed Sep 16, 2014
1 parent e102609 commit 6dd5b02
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/usb/gadget/function/uvc_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@ int uvcg_video_pump(struct uvc_video *video)
/* Retrieve the first available video buffer and fill the
* request, protected by the video queue irqlock.
*/
spin_lock_irqsave(&video->queue.irqlock, flags);
buf = uvcg_queue_head(&video->queue);
spin_lock_irqsave(&queue->irqlock, flags);
buf = uvcg_queue_head(queue);
if (buf == NULL) {
spin_unlock_irqrestore(&video->queue.irqlock, flags);
spin_unlock_irqrestore(&queue->irqlock, flags);
break;
}

Expand All @@ -323,11 +323,11 @@ int uvcg_video_pump(struct uvc_video *video)
if (ret < 0) {
printk(KERN_INFO "Failed to queue request (%d)\n", ret);
usb_ep_set_halt(video->ep);
spin_unlock_irqrestore(&video->queue.irqlock, flags);
spin_unlock_irqrestore(&queue->irqlock, flags);
uvcg_queue_cancel(queue, 0);
break;
}
spin_unlock_irqrestore(&video->queue.irqlock, flags);
spin_unlock_irqrestore(&queue->irqlock, flags);
}

spin_lock_irqsave(&video->req_lock, flags);
Expand Down

0 comments on commit 6dd5b02

Please sign in to comment.