Re: [PATCH/RFC] preserve video-device parent, set by the driver
- Subject: Re: [PATCH/RFC] preserve video-device parent, set by the driver
- From: Hans Verkuil <hverkuil@xxxxxxxxx>
- Date: Fri, 16 Sep 2011 10:49:39 +0200
- Cc: Linux Media Mailing List <linux-media@xxxxxxxxxxxxxxx>, Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
- In-reply-to: <Pine.LNX.4.64.1109152119130.11565@axis700.grange>
- User-agent: KMail/1.13.7 (Linux/3.0-4.slh.3-aptosid-amd64; KDE/4.6.5; x86_64; ; )
On Thursday, September 15, 2011 21:25:17 Guennadi Liakhovetski wrote:
> There doesn't seem to be any real requirement to override video-device
> parent, set by the driver, even if a v4l2-device is linked to the
> video-device, being registered. Let the driver control the parent pointer,
> if it needs to.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
> ---
>
> Marked as RFC, because I'm not sure, that there's no some hidden meaning
> in this parent pointer manipulation. However, I haven't been able to find
> any.
The idea is that the vdev->parent pointer will disappear once all drivers are
converted to struct v4l2_device. So any driver that already uses v4l2_device
shouldn't touch vdev->parent.
So this patch isn't correct. Adding a comment explaining this probably
wouldn't hurt, though :-)
Regards,
Hans
>
> diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
> index 06f1400..728ebaf 100644
> --- a/drivers/media/video/v4l2-dev.c
> +++ b/drivers/media/video/v4l2-dev.c
> @@ -576,7 +576,7 @@ int __video_register_device(struct video_device *vdev, int type, int nr,
> vdev->vfl_type = type;
> vdev->cdev = NULL;
> if (vdev->v4l2_dev) {
> - if (vdev->v4l2_dev->dev)
> + if (vdev->v4l2_dev->dev && !vdev->parent)
> vdev->parent = vdev->v4l2_dev->dev;
> if (vdev->ctrl_handler == NULL)
> vdev->ctrl_handler = vdev->v4l2_dev->ctrl_handler;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux Input]
[Video for Linux]
[Mplayer Users]
[Linux USB Devel]
[Linux Audio Users]
[Photos]
[Yosemite Photos]
[Linux Kernel]
[Linux SCSI]
[XFree86]
[Devices]
[Yosemite Backpacking]