• Hans Verkuil's avatar
    media: videobuf2-v4l2.c: add vb2_video_unregister_device helper function · f729ef57
    Hans Verkuil authored
    If a driver calls (_)vb2_fop_release(), then such a driver should also
    call vb2_video_unregister_device() instead of video_unregister_device().
    This helper will call vb2_queue_release() if a filehandle is marked as
    owner of the queue. This ensures that at unregister time any streaming
    is cancelled and all buffers are returned to userspace.
    
    This is very useful for complex drivers since this stops all streaming
    in all subdevs in the pipeline controlled by this video device. Otherwise
    this would be delayed until the owner filehandle is closed, which can be
    quite some time later.
    
    Bonus points for ordering the includes :-)
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
    f729ef57
videobuf2-v4l2.h 13.2 KB