media: staging/media: drop vb2_queue_release()
This is only needed for drivers that do not use vb2_fop_release(). Note that vb2_queue_release() is *not* the counterpart of vb2_queue_init() as some drivers here seem to think. Also use vb2_video_unregister_device() to automatically stop streaming at unregister time for those drivers that set vdev->queue. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
bda24f4330
commit
2dc73489ae
|
@ -841,13 +841,7 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq,
|
|||
dst_vq->min_buffers_needed = 1;
|
||||
dst_vq->dev = sess->core->dev;
|
||||
dst_vq->lock = &sess->lock;
|
||||
ret = vb2_queue_init(dst_vq);
|
||||
if (ret) {
|
||||
vb2_queue_release(src_vq);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return vb2_queue_init(dst_vq);
|
||||
}
|
||||
|
||||
static int vdec_init_ctrls(struct amvdec_session *sess)
|
||||
|
|
|
@ -1265,7 +1265,7 @@ static const struct v4l2_file_operations rkisp1_fops = {
|
|||
static void rkisp1_unregister_capture(struct rkisp1_capture *cap)
|
||||
{
|
||||
media_entity_cleanup(&cap->vnode.vdev.entity);
|
||||
video_unregister_device(&cap->vnode.vdev);
|
||||
vb2_video_unregister_device(&cap->vnode.vdev);
|
||||
}
|
||||
|
||||
void rkisp1_capture_devs_unregister(struct rkisp1_device *rkisp1)
|
||||
|
|
|
@ -1604,7 +1604,7 @@ int rkisp1_params_register(struct rkisp1_params *params,
|
|||
node->pad.flags = MEDIA_PAD_FL_SOURCE;
|
||||
ret = media_entity_pads_init(&vdev->entity, 1, &node->pad);
|
||||
if (ret)
|
||||
goto err_release_queue;
|
||||
return ret;
|
||||
ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
|
||||
if (ret) {
|
||||
dev_err(rkisp1->dev,
|
||||
|
@ -1614,8 +1614,6 @@ int rkisp1_params_register(struct rkisp1_params *params,
|
|||
return 0;
|
||||
err_cleanup_media_entity:
|
||||
media_entity_cleanup(&vdev->entity);
|
||||
err_release_queue:
|
||||
vb2_queue_release(vdev->queue);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1624,7 +1622,6 @@ void rkisp1_params_unregister(struct rkisp1_params *params)
|
|||
struct rkisp1_vdev_node *node = ¶ms->vnode;
|
||||
struct video_device *vdev = &node->vdev;
|
||||
|
||||
video_unregister_device(vdev);
|
||||
vb2_video_unregister_device(vdev);
|
||||
media_entity_cleanup(&vdev->entity);
|
||||
vb2_queue_release(vdev->queue);
|
||||
}
|
||||
|
|
|
@ -406,7 +406,7 @@ int rkisp1_stats_register(struct rkisp1_stats *stats,
|
|||
node->pad.flags = MEDIA_PAD_FL_SINK;
|
||||
ret = media_entity_pads_init(&vdev->entity, 1, &node->pad);
|
||||
if (ret)
|
||||
goto err_release_queue;
|
||||
goto err_mutex_destroy;
|
||||
|
||||
ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
|
||||
if (ret) {
|
||||
|
@ -419,8 +419,7 @@ int rkisp1_stats_register(struct rkisp1_stats *stats,
|
|||
|
||||
err_cleanup_media_entity:
|
||||
media_entity_cleanup(&vdev->entity);
|
||||
err_release_queue:
|
||||
vb2_queue_release(vdev->queue);
|
||||
err_mutex_destroy:
|
||||
mutex_destroy(&node->vlock);
|
||||
return ret;
|
||||
}
|
||||
|
@ -430,8 +429,7 @@ void rkisp1_stats_unregister(struct rkisp1_stats *stats)
|
|||
struct rkisp1_vdev_node *node = &stats->vnode;
|
||||
struct video_device *vdev = &node->vdev;
|
||||
|
||||
video_unregister_device(vdev);
|
||||
vb2_video_unregister_device(vdev);
|
||||
media_entity_cleanup(&vdev->entity);
|
||||
vb2_queue_release(vdev->queue);
|
||||
mutex_destroy(&node->vlock);
|
||||
}
|
||||
|
|
|
@ -795,12 +795,8 @@ void tegra_v4l2_nodes_cleanup_tpg(struct tegra_video_device *vid)
|
|||
struct tegra_csi_channel *csi_chan;
|
||||
struct tegra_vi_channel *chan;
|
||||
|
||||
list_for_each_entry(chan, &vi->vi_chans, list) {
|
||||
video_unregister_device(&chan->video);
|
||||
mutex_lock(&chan->video_lock);
|
||||
vb2_queue_release(&chan->queue);
|
||||
mutex_unlock(&chan->video_lock);
|
||||
}
|
||||
list_for_each_entry(chan, &vi->vi_chans, list)
|
||||
vb2_video_unregister_device(&chan->video);
|
||||
|
||||
list_for_each_entry(csi_chan, &csi->csi_chans, list)
|
||||
v4l2_device_unregister_subdev(&csi_chan->subdev);
|
||||
|
|
Loading…
Reference in New Issue