[PATCH/RFC] preserve video-device parent, set by the driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux