]> git.openfabrics.org - ~emulex/infiniband.git/commit
[media] vb2: remove the 'fileio = NULL' hack
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 13 Dec 2013 16:13:41 +0000 (13:13 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 7 Jan 2014 09:10:41 +0000 (07:10 -0200)
commitb2f2f04719638322b9d792ecd25f70a55acf8270
treea2f7091a72397315b41aced3774092902b256df3
parent63faabfd89f4db9862ae2a663193e511419c67eb
[media] vb2: remove the 'fileio = NULL' hack

The read/write implementation in vb2 reuses existing vb2 functions, but
it sets q->fileio to NULL before calling them in order to skip the
'q->fileio != NULL' check.

This works today due to the synchronous nature of read/write, but it
1) is ugly, and 2) will fail in an asynchronous use-case such as a
thread queuing and dequeuing buffers. This last example will be necessary
in order to implement vb2 DVB support.

This patch removes the hack by splitting up the dqbuf/qbuf/streamon/streamoff
functions into an external and an internal version. The external version
checks q->fileio and then calls the internal version. The read/write
implementation now just uses the internal version, removing the need to
set q->fileio to NULL.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/videobuf2-core.c