media: : usb: add const to v4l2_file_operations structures
authorBhumika Goyal <bhumirks@gmail.com>
Thu, 29 Jun 2017 06:55:23 +0000 (02:55 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 20 Jul 2017 20:45:25 +0000 (16:45 -0400)
Declare v4l2_file_operations structures as const as they are only stored
in the fops field of video_device structures. This field is of type
const, so declare v4l2_file_operations structures with similar properties
as const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/au0828/au0828-video.c
drivers/media/usb/cx231xx/cx231xx-417.c
drivers/media/usb/go7007/go7007-v4l2.c
drivers/media/usb/gspca/gspca.c
drivers/media/usb/stk1160/stk1160-v4l.c
drivers/media/usb/stkwebcam/stk-webcam.c
drivers/media/usb/tm6000/tm6000-video.c

index 2a255bd32bb39751d7b65f07380307384cc9a39c..9342402b92f76999e1c95d07b5dce2806f727f42 100644 (file)
@@ -1740,7 +1740,7 @@ void au0828_v4l2_resume(struct au0828_dev *dev)
        }
 }
 
-static struct v4l2_file_operations au0828_v4l_fops = {
+static const struct v4l2_file_operations au0828_v4l_fops = {
        .owner      = THIS_MODULE,
        .open       = au0828_v4l2_open,
        .release    = au0828_v4l2_close,
index 509d9711d590047c4017ceab8b6987a891be6e71..8d5eb99deacbf00d8947ee76eb2210e66ef09ee2 100644 (file)
@@ -1843,7 +1843,7 @@ static int mpeg_mmap(struct file *file, struct vm_area_struct *vma)
        return videobuf_mmap_mapper(&fh->vidq, vma);
 }
 
-static struct v4l2_file_operations mpeg_fops = {
+static const struct v4l2_file_operations mpeg_fops = {
        .owner         = THIS_MODULE,
        .open          = mpeg_open,
        .release       = mpeg_release,
index ed5ec97739691dcf2bf7ed0bce1a573c0b0ec87e..445f17b850c5178317615722a2f42bf38ab3bd0d 100644 (file)
@@ -857,7 +857,7 @@ static int go7007_s_ctrl(struct v4l2_ctrl *ctrl)
        return 0;
 }
 
-static struct v4l2_file_operations go7007_fops = {
+static const struct v4l2_file_operations go7007_fops = {
        .owner          = THIS_MODULE,
        .open           = v4l2_fh_open,
        .release        = vb2_fop_release,
index 16bc1dde2c8cd5ed341c8356dc0e48598c4dd43d..0f141762abf17c6d2c8c703863bb82dbee757094 100644 (file)
@@ -1964,7 +1964,7 @@ out:
        return ret;
 }
 
-static struct v4l2_file_operations dev_fops = {
+static const struct v4l2_file_operations dev_fops = {
        .owner = THIS_MODULE,
        .open = dev_open,
        .release = dev_close,
index a005d262392acb277c8952cec61f34a15c10882b..a132faa590df7b083eb3ed78161fc3a50bb2b57a 100644 (file)
@@ -326,7 +326,7 @@ static int stk1160_stop_streaming(struct stk1160 *dev)
        return 0;
 }
 
-static struct v4l2_file_operations stk1160_fops = {
+static const struct v4l2_file_operations stk1160_fops = {
        .owner = THIS_MODULE,
        .open = v4l2_fh_open,
        .release = vb2_fop_release,
index 90d4a08cda31637fc47e5f9a3d8286cebbb613e5..93330be8cc54b5e6195b09264c00515980e4c30f 100644 (file)
@@ -1202,7 +1202,7 @@ static const struct v4l2_ctrl_ops stk_ctrl_ops = {
        .s_ctrl = stk_s_ctrl,
 };
 
-static struct v4l2_file_operations v4l_stk_fops = {
+static const struct v4l2_file_operations v4l_stk_fops = {
        .owner = THIS_MODULE,
        .open = v4l_stk_open,
        .release = v4l_stk_release,
index 7e960d0a5b929bb6c5dff6ac544b643063bd7b7a..cec1321289dfe21feec028c78d1cca60fd50619f 100644 (file)
@@ -1532,7 +1532,7 @@ static int tm6000_mmap(struct file *file, struct vm_area_struct * vma)
        return res;
 }
 
-static struct v4l2_file_operations tm6000_fops = {
+static const struct v4l2_file_operations tm6000_fops = {
        .owner = THIS_MODULE,
        .open = tm6000_open,
        .release = tm6000_release,