diff options
| author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2014-09-16 10:26:48 -0400 |
|---|---|---|
| committer | Felipe Balbi <balbi@ti.com> | 2014-09-16 10:59:54 -0400 |
| commit | 6dd5b021bd6c735a6a1515d06dab1478fc461dfd (patch) | |
| tree | ffbe8ccd42feeaad54ca08e252d4e12d74572933 /drivers/usb/gadget/function | |
| parent | e102609f107269fbc04af21548e78e99c02b6204 (diff) | |
usb: gadget: uvc: Simplify uvcg_video_pump by using local variable
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>
Diffstat (limited to 'drivers/usb/gadget/function')
| -rw-r--r-- | drivers/usb/gadget/function/uvc_video.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/gadget/function/uvc_video.c b/drivers/usb/gadget/function/uvc_video.c index b0528e8138cf..c3e1f27dbbef 100644 --- a/drivers/usb/gadget/function/uvc_video.c +++ b/drivers/usb/gadget/function/uvc_video.c | |||
| @@ -309,10 +309,10 @@ int uvcg_video_pump(struct uvc_video *video) | |||
| 309 | /* Retrieve the first available video buffer and fill the | 309 | /* Retrieve the first available video buffer and fill the |
| 310 | * request, protected by the video queue irqlock. | 310 | * request, protected by the video queue irqlock. |
| 311 | */ | 311 | */ |
| 312 | spin_lock_irqsave(&video->queue.irqlock, flags); | 312 | spin_lock_irqsave(&queue->irqlock, flags); |
| 313 | buf = uvcg_queue_head(&video->queue); | 313 | buf = uvcg_queue_head(queue); |
| 314 | if (buf == NULL) { | 314 | if (buf == NULL) { |
| 315 | spin_unlock_irqrestore(&video->queue.irqlock, flags); | 315 | spin_unlock_irqrestore(&queue->irqlock, flags); |
| 316 | break; | 316 | break; |
| 317 | } | 317 | } |
| 318 | 318 | ||
| @@ -323,11 +323,11 @@ int uvcg_video_pump(struct uvc_video *video) | |||
| 323 | if (ret < 0) { | 323 | if (ret < 0) { |
| 324 | printk(KERN_INFO "Failed to queue request (%d)\n", ret); | 324 | printk(KERN_INFO "Failed to queue request (%d)\n", ret); |
| 325 | usb_ep_set_halt(video->ep); | 325 | usb_ep_set_halt(video->ep); |
| 326 | spin_unlock_irqrestore(&video->queue.irqlock, flags); | 326 | spin_unlock_irqrestore(&queue->irqlock, flags); |
| 327 | uvcg_queue_cancel(queue, 0); | 327 | uvcg_queue_cancel(queue, 0); |
| 328 | break; | 328 | break; |
| 329 | } | 329 | } |
| 330 | spin_unlock_irqrestore(&video->queue.irqlock, flags); | 330 | spin_unlock_irqrestore(&queue->irqlock, flags); |
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | spin_lock_irqsave(&video->req_lock, flags); | 333 | spin_lock_irqsave(&video->req_lock, flags); |
