[RK3288][Android6.0] 调试笔记 --- Camera设备节点往后偏移

Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92

现象:
默认有/dev/video0, /dev/video1, 拔掉/dev/video1之后再插上,理论上还是/dev/video0和/dev/video1,
但却变成了/dev/video0和/dev/video2

解决方法:

kris@:~/rk3288/kernel$ g df drivers/media/v4l2-core/v4l2-dev.c
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index 5923c5d..3d615fc 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -973,6 +973,10 @@ void video_unregister_device(struct video_device *vdev)
         */
        clear_bit(V4L2_FL_REGISTERED, &vdev->flags);
        mutex_unlock(&videodev_lock);
+
+       /*Kris, 20170907, clear node after plug out.*/
+       devnode_clear(vdev);
+       
        device_unregister(&vdev->dev);
 }

你可能感兴趣的:(子类__Camera)