Re: [PATCH 3/6] media: staging: rkisp1: initialize buffer lists only on probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 10/2/20 3:42 PM, Dafna Hirschfeld wrote:
> 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@xxxxxxxxxxxxx>

Acked-by: Helen Koike <helen.koike@xxxxxxxxxxxxx>

Thanks
Helen

> ---
>  drivers/staging/media/rkisp1/rkisp1-params.c | 4 +---
>  drivers/staging/media/rkisp1/rkisp1-stats.c  | 4 ----
>  2 files changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/media/rkisp1/rkisp1-params.c b/drivers/staging/media/rkisp1/rkisp1-params.c
> index cb9f3332a9a0..aa758f8c2264 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-params.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-params.c
> @@ -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));
> diff --git a/drivers/staging/media/rkisp1/rkisp1-stats.c b/drivers/staging/media/rkisp1/rkisp1-stats.c
> index 51c64f75fe29..c58ae52b8a98 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-stats.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-stats.c
> @@ -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;
>  }
>  
> 



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux