public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Mike Isely <isely@isely.net>,
	Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [REVIEWv2 PATCH 08/12] f_uvc: add v4l2_device and replace parent with v4l2_dev
Date: Mon, 17 Jun 2013 22:12:02 +0200	[thread overview]
Message-ID: <2193306.FIqlzJFcP5@avalon> (raw)
In-Reply-To: <1371049262-5799-9-git-send-email-hverkuil@xs4all.nl>

Hi Hans,

Thanks for the patch.

On Wednesday 12 June 2013 17:00:58 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> This driver did not yet support struct v4l2_device, so add it. This
> make it possible to replace the deprecated parent field with the
> v4l2_dev field, allowing the eventual removal of the parent field.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/usb/gadget/f_uvc.c |    9 ++++++++-
>  drivers/usb/gadget/uvc.h   |    2 ++
>  2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
> index 38dcedd..1d06567 100644
> --- a/drivers/usb/gadget/f_uvc.c
> +++ b/drivers/usb/gadget/f_uvc.c
> @@ -413,7 +413,7 @@ uvc_register_video(struct uvc_device *uvc)
>  	if (video == NULL)
>  		return -ENOMEM;
> 
> -	video->parent = &cdev->gadget->dev;
> +	video->v4l2_dev = &uvc->v4l2_dev;
>  	video->fops = &uvc_v4l2_fops;
>  	video->release = video_device_release;
>  	strlcpy(video->name, cdev->gadget->name, sizeof(video->name));
> @@ -570,6 +570,7 @@ uvc_function_unbind(struct usb_configuration *c, struct
> usb_function *f) INFO(cdev, "uvc_function_unbind\n");
> 
>  	video_unregister_device(uvc->vdev);
> +	v4l2_device_unregister(&uvc->v4l2_dev);
>  	uvc->control_ep->driver_data = NULL;
>  	uvc->video.ep->driver_data = NULL;
> 
> @@ -697,6 +698,11 @@ uvc_function_bind(struct usb_configuration *c, struct
> usb_function *f) if ((ret = usb_function_deactivate(f)) < 0)
>  		goto error;
> 
> +	if (v4l2_device_register(&cdev->gadget->dev, &uvc->v4l2_dev)) {
> +		printk(KERN_INFO "v4l2_device_register failed\n");
> +		goto error;
> +	}
> +
>  	/* Initialise video. */
>  	ret = uvc_video_init(&uvc->video);
>  	if (ret < 0)
> @@ -712,6 +718,7 @@ uvc_function_bind(struct usb_configuration *c, struct
> usb_function *f) return 0;
> 
>  error:
> +	v4l2_device_unregister(&uvc->v4l2_dev);
>  	if (uvc->vdev)
>  		video_device_release(uvc->vdev);
> 
> diff --git a/drivers/usb/gadget/uvc.h b/drivers/usb/gadget/uvc.h
> index 817e9e1..7a9111d 100644
> --- a/drivers/usb/gadget/uvc.h
> +++ b/drivers/usb/gadget/uvc.h
> @@ -57,6 +57,7 @@ struct uvc_event
>  #include <linux/videodev2.h>
>  #include <linux/version.h>
>  #include <media/v4l2-fh.h>
> +#include <media/v4l2-device.h>
> 
>  #include "uvc_queue.h"
> 
> @@ -145,6 +146,7 @@ enum uvc_state
>  struct uvc_device
>  {
>  	struct video_device *vdev;
> +	struct v4l2_device v4l2_dev;
>  	enum uvc_state state;
>  	struct usb_function func;
>  	struct uvc_video video;
-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2013-06-17 20:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-12 15:00 [REVIEWv2 PATCH 00/11] Use v4l2_dev instead of parent Hans Verkuil
2013-06-12 15:00 ` [REVIEWv2 PATCH 01/12] v4l2-device: check if already unregistered Hans Verkuil
2013-06-12 17:46   ` Prabhakar Lad
2013-06-12 15:00 ` [REVIEWv2 PATCH 02/12] soc_camera: replace vdev->parent by vdev->v4l2_dev Hans Verkuil
2013-06-18  6:13   ` Hans Verkuil
2013-06-18  7:34   ` Guennadi Liakhovetski
2013-06-12 15:00 ` [REVIEWv2 PATCH 03/12] cx23885-417: use v4l2_dev instead of the deprecated parent field Hans Verkuil
2013-06-12 15:00 ` [REVIEWv2 PATCH 04/12] zoran: " Hans Verkuil
2013-06-12 15:00 ` [REVIEWv2 PATCH 05/12] sn9c102_core: add v4l2_device and replace parent with v4l2_dev Hans Verkuil
2013-06-12 15:00 ` [REVIEWv2 PATCH 06/12] saa7164: " Hans Verkuil
2013-06-12 15:00 ` [REVIEWv2 PATCH 07/12] pvrusb2: use v4l2_dev instead of the deprecated parent field Hans Verkuil
2013-06-12 15:12   ` Mike Isely
2013-06-12 15:00 ` [REVIEWv2 PATCH 08/12] f_uvc: add v4l2_device and replace parent with v4l2_dev Hans Verkuil
2013-06-17 20:12   ` Laurent Pinchart [this message]
2013-06-12 15:00 ` [REVIEWv2 PATCH 09/12] omap24xxcam: " Hans Verkuil
2013-06-12 15:01 ` [REVIEWv2 PATCH 10/12] v4l2: always require v4l2_dev, rename parent to dev_parent Hans Verkuil
2013-06-12 15:01 ` [REVIEWv2 PATCH 11/12] cx88: set dev_parent to the correct parent PCI bus Hans Verkuil
2013-06-12 15:01 ` [REVIEWv2 PATCH 12/12] v4l2-framework: update documentation Hans Verkuil
2013-06-17 20:14   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2193306.FIqlzJFcP5@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=isely@isely.net \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox