diff options
Diffstat (limited to 'drivers/media/usb/pwc')
| -rw-r--r-- | drivers/media/usb/pwc/pwc-if.c | 29 | 
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c index 77bbf788965..a73b0bced96 100644 --- a/drivers/media/usb/pwc/pwc-if.c +++ b/drivers/media/usb/pwc/pwc-if.c @@ -614,17 +614,20 @@ static int buffer_prepare(struct vb2_buffer *vb)  	return 0;  } -static int buffer_finish(struct vb2_buffer *vb) +static void buffer_finish(struct vb2_buffer *vb)  {  	struct pwc_device *pdev = vb2_get_drv_priv(vb->vb2_queue);  	struct pwc_frame_buf *buf = container_of(vb, struct pwc_frame_buf, vb); -	/* -	 * Application has called dqbuf and is getting back a buffer we've -	 * filled, take the pwc data we've stored in buf->data and decompress -	 * it into a usable format, storing the result in the vb2_buffer -	 */ -	return pwc_decompress(pdev, buf); +	if (vb->state == VB2_BUF_STATE_DONE) { +		/* +		 * Application has called dqbuf and is getting back a buffer +		 * we've filled, take the pwc data we've stored in buf->data +		 * and decompress it into a usable format, storing the result +		 * in the vb2_buffer. +		 */ +		pwc_decompress(pdev, buf); +	}  }  static void buffer_cleanup(struct vb2_buffer *vb) @@ -678,12 +681,11 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)  	return r;  } -static int stop_streaming(struct vb2_queue *vq) +static void stop_streaming(struct vb2_queue *vq)  {  	struct pwc_device *pdev = vb2_get_drv_priv(vq); -	if (mutex_lock_interruptible(&pdev->v4l2_lock)) -		return -ERESTARTSYS; +	mutex_lock(&pdev->v4l2_lock);  	if (pdev->udev) {  		pwc_set_leds(pdev, 0, 0);  		pwc_camera_power(pdev, 0); @@ -692,8 +694,6 @@ static int stop_streaming(struct vb2_queue *vq)  	pwc_cleanup_queued_bufs(pdev);  	mutex_unlock(&pdev->v4l2_lock); - -	return 0;  }  static struct vb2_ops pwc_vb_queue_ops = { @@ -1001,7 +1001,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id  	pdev->vb_queue.buf_struct_size = sizeof(struct pwc_frame_buf);  	pdev->vb_queue.ops = &pwc_vb_queue_ops;  	pdev->vb_queue.mem_ops = &vb2_vmalloc_memops; -	pdev->vb_queue.timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; +	pdev->vb_queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;  	rc = vb2_queue_init(&pdev->vb_queue);  	if (rc < 0) {  		PWC_ERROR("Oops, could not initialize vb2 queue.\n"); @@ -1039,7 +1039,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id  	/* Set the leds off */  	pwc_set_leds(pdev, 0, 0); -	/* Setup intial videomode */ +	/* Setup initial videomode */  	rc = pwc_set_video_mode(pdev, MAX_WIDTH, MAX_HEIGHT,  				V4L2_PIX_FMT_YUV420, 30, &compression, 1);  	if (rc) @@ -1078,7 +1078,6 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id  	/* register webcam snapshot button input device */  	pdev->button_dev = input_allocate_device();  	if (!pdev->button_dev) { -		PWC_ERROR("Err, insufficient memory for webcam snapshot button device.");  		rc = -ENOMEM;  		goto err_video_unreg;  	}  | 
