OSDN Git Service

media: staging: rkisp1: initialize buffer lists only on probe
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Fri, 2 Oct 2020 18:42:19 +0000 (20:42 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 16 Nov 2020 09:31:08 +0000 (10:31 +0100)
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: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/rkisp1/rkisp1-params.c
drivers/staging/media/rkisp1/rkisp1-stats.c

index cb9f333..aa758f8 100644 (file)
@@ -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));
index 51c64f7..c58ae52 100644 (file)
@@ -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;
 }