提交 60fcc5be 编写于 作者: D Dafna Hirschfeld 提交者: Mauro Carvalho Chehab

media: staging: rkisp1: initialize buffer lists only on probe

The buffer lists of stats and params entities
are initialized in queue_setup callback with
'INIT_LIST_HEAD'. It is enough to initialize
the lists only upon registration.
For the stats entity the list is already
initialize upon registration.
Signed-off-by: NDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: NHelen Koike <helen.koike@collabora.com>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
上级 dd481340
......@@ -1420,8 +1420,6 @@ static int rkisp1_params_vb2_queue_setup(struct vb2_queue *vq,
unsigned int sizes[],
struct device *alloc_devs[])
{
struct rkisp1_params *params = vq->drv_priv;
*num_buffers = clamp_t(u32, *num_buffers,
RKISP1_ISP_PARAMS_REQ_BUFS_MIN,
RKISP1_ISP_PARAMS_REQ_BUFS_MAX);
......@@ -1430,7 +1428,6 @@ static int rkisp1_params_vb2_queue_setup(struct vb2_queue *vq,
sizes[0] = sizeof(struct rkisp1_params_cfg);
INIT_LIST_HEAD(&params->params);
return 0;
}
......@@ -1545,6 +1542,7 @@ int rkisp1_params_register(struct rkisp1_device *rkisp1)
params->rkisp1 = rkisp1;
mutex_init(&node->vlock);
INIT_LIST_HEAD(&params->params);
spin_lock_init(&params->config_lock);
strscpy(vdev->name, RKISP1_PARAMS_DEV_NAME, sizeof(vdev->name));
......
......@@ -94,8 +94,6 @@ static int rkisp1_stats_vb2_queue_setup(struct vb2_queue *vq,
unsigned int sizes[],
struct device *alloc_devs[])
{
struct rkisp1_stats *stats = vq->drv_priv;
*num_planes = 1;
*num_buffers = clamp_t(u32, *num_buffers, RKISP1_ISP_STATS_REQ_BUFS_MIN,
......@@ -103,8 +101,6 @@ static int rkisp1_stats_vb2_queue_setup(struct vb2_queue *vq,
sizes[0] = sizeof(struct rkisp1_stat_buffer);
INIT_LIST_HEAD(&stats->stat);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册