media: platform: constify videobuf_queue_ops structures
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Tue, 22 Aug 2017 12:56:35 +0000 (08:56 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 26 Aug 2017 18:30:25 +0000 (14:30 -0400)
videobuf_queue_ops are not supposed to change at runtime. All functions
working with videobuf_queue_ops provided by <media/videobuf-core.h> work
with const videobuf_queue_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/davinci/vpfe_capture.c
drivers/media/platform/fsl-viu.c

index b1bf4a7..6792da1 100644 (file)
@@ -1288,7 +1288,7 @@ static void vpfe_videobuf_release(struct videobuf_queue *vq,
        vb->state = VIDEOBUF_NEEDS_INIT;
 }
 
-static struct videobuf_queue_ops vpfe_videobuf_qops = {
+static const struct videobuf_queue_ops vpfe_videobuf_qops = {
        .buf_setup      = vpfe_videobuf_setup,
        .buf_prepare    = vpfe_videobuf_prepare,
        .buf_queue      = vpfe_videobuf_queue,
index f7b88e5..2e06dd5 100644 (file)
@@ -549,7 +549,7 @@ static void buffer_release(struct videobuf_queue *vq,
        free_buffer(vq, buf);
 }
 
-static struct videobuf_queue_ops viu_video_qops = {
+static const struct videobuf_queue_ops viu_video_qops = {
        .buf_setup      = buffer_setup,
        .buf_prepare    = buffer_prepare,
        .buf_queue      = buffer_queue,