Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] vb2: don't set index, don't start streaming for write()

Two fixes:

- there is no need to set the index when calling dqbuf: dqbuf will
overwrite it.
- __vb2_init_fileio already starts streaming for write(), so there is
no need to do it again in __vb2_perform_fileio. It can never have
worked anyway: either __vb2_init_fileio succeeds in starting streaming
or it is never going to happen.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
c108e660 02f142ec

-10
-10
drivers/media/v4l2-core/videobuf2-core.c
··· 2445 2445 memset(&fileio->b, 0, sizeof(fileio->b)); 2446 2446 fileio->b.type = q->type; 2447 2447 fileio->b.memory = q->memory; 2448 - fileio->b.index = index; 2449 2448 ret = vb2_internal_dqbuf(q, &fileio->b, nonblock); 2450 2449 dprintk(5, "file io: vb2_dqbuf result: %d\n", ret); 2451 2450 if (ret) ··· 2526 2527 * Switch to the next buffer 2527 2528 */ 2528 2529 fileio->index = (index + 1) % q->num_buffers; 2529 - 2530 - /* 2531 - * Start streaming if required. 2532 - */ 2533 - if (!read && !q->streaming) { 2534 - ret = vb2_internal_streamon(q, q->type); 2535 - if (ret) 2536 - return ret; 2537 - } 2538 2530 } 2539 2531 2540 2532 /*