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.liakhovet...@gmx.de>
> ---
> 
> 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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to