mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-29 15:15:28 -04:00
media: staging: rkisp1: params: in stop_streaming, use list_splice_init to move the buffers
Currently the code uses 'list_cut_position' to move the buffers to a temporary list. Replace it with 'list_splice_init'. This is nicer since we don't need to access params.prev. Also, replace INIT_LIST_HEAD with the simpler LIST_HEAD. 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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
35d1a7bbe4
commit
dd48134061
@@ -1462,9 +1462,7 @@ static void rkisp1_params_vb2_stop_streaming(struct vb2_queue *vq)
|
||||
{
|
||||
struct rkisp1_params *params = vq->drv_priv;
|
||||
struct rkisp1_buffer *buf;
|
||||
struct list_head tmp_list;
|
||||
|
||||
INIT_LIST_HEAD(&tmp_list);
|
||||
LIST_HEAD(tmp_list);
|
||||
|
||||
/*
|
||||
* we first move the buffers into a local list 'tmp_list'
|
||||
@@ -1473,7 +1471,7 @@ static void rkisp1_params_vb2_stop_streaming(struct vb2_queue *vq)
|
||||
*/
|
||||
spin_lock_irq(¶ms->config_lock);
|
||||
params->is_streaming = false;
|
||||
list_cut_position(&tmp_list, ¶ms->params, params->params.prev);
|
||||
list_splice_init(¶ms->params, &tmp_list);
|
||||
spin_unlock_irq(¶ms->config_lock);
|
||||
|
||||
list_for_each_entry(buf, &tmp_list, queue)
|
||||
|
||||
Reference in New Issue
Block a user