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

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

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 

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]

Add to Google Powered by Linux