@@ -197,7 +197,7 @@ static void v4l2_device_release(struct device *cd)
if (v4l2_dev->mdev) {
/* Remove interfaces and interface links */
media_devnode_remove(vdev->intf_devnode);
- if (vdev->vfl_type != VFL_TYPE_SUBDEV)
+ if (vdev->entity.type)
media_device_unregister_entity(&vdev->entity);
}
#endif
@@ -775,6 +775,8 @@ static int video_register_media_controller(struct video_device *vdev, int type)
__func__);
return ret;
}
+ } else {
+ vdev->entity.type = 0;
}
vdev->intf_devnode = media_devnode_create(vdev->v4l2_dev->mdev,