OSDN Git Service

[media] v4l2: add const to argument of write-only s_register ioctl
authorHans Verkuil <hans.verkuil@cisco.com>
Sun, 24 Mar 2013 11:28:46 +0000 (08:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 24 Mar 2013 11:47:01 +0000 (08:47 -0300)
This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
69 files changed:
drivers/media/dvb-frontends/au8522_decoder.c
drivers/media/i2c/ad9389b.c
drivers/media/i2c/adv7183.c
drivers/media/i2c/adv7604.c
drivers/media/i2c/ak881x.c
drivers/media/i2c/cs5345.c
drivers/media/i2c/cx25840/cx25840-core.c
drivers/media/i2c/m52790.c
drivers/media/i2c/mt9m032.c
drivers/media/i2c/mt9v011.c
drivers/media/i2c/ov7670.c
drivers/media/i2c/saa7115.c
drivers/media/i2c/saa7127.c
drivers/media/i2c/saa717x.c
drivers/media/i2c/soc_camera/mt9m001.c
drivers/media/i2c/soc_camera/mt9m111.c
drivers/media/i2c/soc_camera/mt9t031.c
drivers/media/i2c/soc_camera/mt9t112.c
drivers/media/i2c/soc_camera/mt9v022.c
drivers/media/i2c/soc_camera/ov2640.c
drivers/media/i2c/soc_camera/ov5642.c
drivers/media/i2c/soc_camera/ov6650.c
drivers/media/i2c/soc_camera/ov772x.c
drivers/media/i2c/soc_camera/ov9640.c
drivers/media/i2c/soc_camera/ov9740.c
drivers/media/i2c/soc_camera/rj54n1cb0c.c
drivers/media/i2c/soc_camera/tw9910.c
drivers/media/i2c/ths7303.c
drivers/media/i2c/tvp5150.c
drivers/media/i2c/tvp7002.c
drivers/media/i2c/upd64031a.c
drivers/media/i2c/upd64083.c
drivers/media/i2c/vs6624.c
drivers/media/pci/bt8xx/bttv-driver.c
drivers/media/pci/cx18/cx18-av-core.c
drivers/media/pci/cx18/cx18-ioctl.c
drivers/media/pci/cx23885/cx23885-ioctl.c
drivers/media/pci/cx23885/cx23885-ioctl.h
drivers/media/pci/cx23885/cx23888-ir.c
drivers/media/pci/cx25821/cx25821-video.c
drivers/media/pci/cx25821/cx25821-video.h
drivers/media/pci/cx88/cx88-video.c
drivers/media/pci/ivtv/ivtv-ioctl.c
drivers/media/pci/saa7134/saa7134-video.c
drivers/media/pci/saa7146/mxb.c
drivers/media/pci/saa7164/saa7164-encoder.c
drivers/media/platform/blackfin/bfin_capture.c
drivers/media/platform/davinci/vpbe_display.c
drivers/media/platform/davinci/vpif_capture.c
drivers/media/platform/davinci/vpif_display.c
drivers/media/platform/marvell-ccic/mcam-core.c
drivers/media/platform/sh_vou.c
drivers/media/platform/soc_camera/soc_camera.c
drivers/media/usb/au0828/au0828-video.c
drivers/media/usb/cx231xx/cx231xx-video.c
drivers/media/usb/cx231xx/cx231xx.h
drivers/media/usb/em28xx/em28xx-video.c
drivers/media/usb/gspca/gspca.c
drivers/media/usb/gspca/gspca.h
drivers/media/usb/gspca/pac7302.c
drivers/media/usb/gspca/sn9c20x.c
drivers/media/usb/pvrusb2/pvrusb2-hdw.c
drivers/media/usb/pvrusb2/pvrusb2-hdw.h
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
drivers/media/usb/stk1160/stk1160-v4l.c
drivers/media/usb/usbvision/usbvision-video.c
drivers/media/v4l2-core/v4l2-ioctl.c
include/media/v4l2-ioctl.h
include/media/v4l2-subdev.h

index 5243ba6..526902b 100644 (file)
@@ -583,7 +583,7 @@ static int au8522_g_register(struct v4l2_subdev *sd,
 }
 
 static int au8522_s_register(struct v4l2_subdev *sd,
-                            struct v4l2_dbg_register *reg)
+                            const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        struct au8522_state *state = to_state(sd);
index c2886b6..58344b6 100644 (file)
@@ -354,7 +354,7 @@ static int ad9389b_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
        return 0;
 }
 
-static int ad9389b_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int ad9389b_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 6fed5b7..56a1fa4 100644 (file)
@@ -507,7 +507,7 @@ static int adv7183_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
        return 0;
 }
 
-static int adv7183_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int adv7183_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index f47555b..31a63c9 100644 (file)
@@ -699,7 +699,7 @@ static int adv7604_g_register(struct v4l2_subdev *sd,
 }
 
 static int adv7604_s_register(struct v4l2_subdev *sd,
-                                       struct v4l2_dbg_register *reg)
+                                       const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index ba67465..fd47465 100644 (file)
@@ -101,7 +101,7 @@ static int ak881x_g_register(struct v4l2_subdev *sd,
 }
 
 static int ak881x_s_register(struct v4l2_subdev *sd,
-                            struct v4l2_dbg_register *reg)
+                            const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index c8581e2..1d2f7c8 100644 (file)
@@ -110,7 +110,7 @@ static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
        return 0;
 }
 
-static int cs5345_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int cs5345_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 234b7c6..12fb9b2 100644 (file)
@@ -1671,7 +1671,7 @@ static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
        return 0;
 }
 
-static int cx25840_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int cx25840_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 0991576..39f50fd 100644 (file)
@@ -96,7 +96,7 @@ static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
        return 0;
 }
 
-static int m52790_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int m52790_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct m52790_state *state = to_state(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
index f80c1d7..2526b66 100644 (file)
@@ -548,7 +548,7 @@ static int mt9m032_g_register(struct v4l2_subdev *sd,
 }
 
 static int mt9m032_s_register(struct v4l2_subdev *sd,
-                             struct v4l2_dbg_register *reg)
+                             const struct v4l2_dbg_register *reg)
 {
        struct mt9m032 *sensor = to_mt9m032(sd);
        struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev);
index 73b7688..3f415fd 100644 (file)
@@ -421,7 +421,7 @@ static int mt9v011_g_register(struct v4l2_subdev *sd,
 }
 
 static int mt9v011_s_register(struct v4l2_subdev *sd,
-                             struct v4l2_dbg_register *reg)
+                             const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 05ed5b8..617ad3f 100644 (file)
@@ -1487,7 +1487,7 @@ static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
        return ret;
 }
 
-static int ov7670_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 6b6788c..5d9d033 100644 (file)
@@ -1428,7 +1428,7 @@ static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
        return 0;
 }
 
-static int saa711x_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int saa711x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index b745f68..8a47ac1 100644 (file)
@@ -672,7 +672,7 @@ static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
        return 0;
 }
 
-static int saa7127_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int saa7127_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 5608b93..cf3a0aa 100644 (file)
@@ -988,7 +988,7 @@ static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
        return 0;
 }
 
-static int saa717x_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int saa717x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        u16 addr = reg->reg & 0xffff;
index bcdc861..dd90898 100644 (file)
@@ -360,7 +360,7 @@ static int mt9m001_g_register(struct v4l2_subdev *sd,
 }
 
 static int mt9m001_s_register(struct v4l2_subdev *sd,
-                             struct v4l2_dbg_register *reg)
+                             const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 2902ba6..8bd4e0d 100644 (file)
@@ -641,7 +641,7 @@ static int mt9m111_g_register(struct v4l2_subdev *sd,
 }
 
 static int mt9m111_s_register(struct v4l2_subdev *sd,
-                             struct v4l2_dbg_register *reg)
+                             const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index d80d044..26a15b8 100644 (file)
@@ -430,7 +430,7 @@ static int mt9t031_g_register(struct v4l2_subdev *sd,
 }
 
 static int mt9t031_s_register(struct v4l2_subdev *sd,
-                             struct v4l2_dbg_register *reg)
+                             const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 188e29b..a7256b7 100644 (file)
@@ -766,7 +766,7 @@ static int mt9t112_g_register(struct v4l2_subdev *sd,
 }
 
 static int mt9t112_s_register(struct v4l2_subdev *sd,
-                             struct v4l2_dbg_register *reg)
+                             const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        int ret;
index 53eaf89..a295e59 100644 (file)
@@ -497,7 +497,7 @@ static int mt9v022_g_register(struct v4l2_subdev *sd,
 }
 
 static int mt9v022_s_register(struct v4l2_subdev *sd,
-                             struct v4l2_dbg_register *reg)
+                             const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 0f520f6..e316842 100644 (file)
@@ -756,7 +756,7 @@ static int ov2640_g_register(struct v4l2_subdev *sd,
 }
 
 static int ov2640_s_register(struct v4l2_subdev *sd,
-                            struct v4l2_dbg_register *reg)
+                            const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 9d53309..9aa56de 100644 (file)
@@ -708,7 +708,7 @@ static int ov5642_get_register(struct v4l2_subdev *sd, struct v4l2_dbg_register
        return ret;
 }
 
-static int ov5642_set_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int ov5642_set_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index dbe4f56..991202d 100644 (file)
@@ -421,7 +421,7 @@ static int ov6650_get_register(struct v4l2_subdev *sd,
 }
 
 static int ov6650_set_register(struct v4l2_subdev *sd,
-                               struct v4l2_dbg_register *reg)
+                               const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index fbeb5b2..713d62e 100644 (file)
@@ -652,7 +652,7 @@ static int ov772x_g_register(struct v4l2_subdev *sd,
 }
 
 static int ov772x_s_register(struct v4l2_subdev *sd,
-                            struct v4l2_dbg_register *reg)
+                            const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 0599304..20ca62d 100644 (file)
@@ -322,7 +322,7 @@ static int ov9640_get_register(struct v4l2_subdev *sd,
 }
 
 static int ov9640_set_register(struct v4l2_subdev *sd,
-                               struct v4l2_dbg_register *reg)
+                               const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 2f236da..012bd62 100644 (file)
@@ -835,7 +835,7 @@ static int ov9740_get_register(struct v4l2_subdev *sd,
 }
 
 static int ov9740_set_register(struct v4l2_subdev *sd,
-                              struct v4l2_dbg_register *reg)
+                              const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 5c92679..1f9ec3b 100644 (file)
@@ -1161,7 +1161,7 @@ static int rj54n1_g_register(struct v4l2_subdev *sd,
 }
 
 static int rj54n1_s_register(struct v4l2_subdev *sd,
-                            struct v4l2_dbg_register *reg)
+                            const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 7d20746..bad90b1 100644 (file)
@@ -554,7 +554,7 @@ static int tw9910_g_register(struct v4l2_subdev *sd,
 }
 
 static int tw9910_s_register(struct v4l2_subdev *sd,
-                            struct v4l2_dbg_register *reg)
+                            const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 3ca60c7..c433955 100644 (file)
@@ -245,7 +245,7 @@ static int ths7303_g_register(struct v4l2_subdev *sd,
 }
 
 static int ths7303_s_register(struct v4l2_subdev *sd,
-                             struct v4l2_dbg_register *reg)
+                             const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 5967e1a..485159a 100644 (file)
@@ -1067,7 +1067,7 @@ static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
        return 0;
 }
 
-static int tvp5150_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int tvp5150_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 7406de9..027809c 100644 (file)
@@ -768,7 +768,7 @@ static int tvp7002_g_register(struct v4l2_subdev *sd,
  * -EPERM if call not allowed.
  */
 static int tvp7002_s_register(struct v4l2_subdev *sd,
-                                               struct v4l2_dbg_register *reg)
+                                               const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index d15cfd9..f0a0921 100644 (file)
@@ -175,7 +175,7 @@ static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register
        return 0;
 }
 
-static int upd64031a_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int upd64031a_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 75d6acc..343e021 100644 (file)
@@ -133,7 +133,7 @@ static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register
        return 0;
 }
 
-static int upd64083_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int upd64083_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 9ac1b8c..f366fad 100644 (file)
@@ -748,7 +748,7 @@ static int vs6624_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
        return 0;
 }
 
-static int vs6624_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int vs6624_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 4b9a256..e33a2d2 100644 (file)
@@ -1945,7 +1945,7 @@ static int bttv_g_register(struct file *file, void *f,
 }
 
 static int bttv_s_register(struct file *file, void *f,
-                                       struct v4l2_dbg_register *reg)
+                                       const struct v4l2_dbg_register *reg)
 {
        struct bttv_fh *fh = f;
        struct bttv *btv = fh->btv;
@@ -1961,8 +1961,7 @@ static int bttv_s_register(struct file *file, void *f,
        }
 
        /* bt848 has a 12-bit register space */
-       reg->reg &= 0xfff;
-       btwrite(reg->val, reg->reg);
+       btwrite(reg->val, reg->reg & 0xfff);
 
        return 0;
 }
index c22242b..38b1d64 100644 (file)
@@ -1266,7 +1266,7 @@ static int cx18_av_g_register(struct v4l2_subdev *sd,
 }
 
 static int cx18_av_s_register(struct v4l2_subdev *sd,
-                             struct v4l2_dbg_register *reg)
+                             const struct v4l2_dbg_register *reg)
 {
        struct cx18 *cx = v4l2_get_subdevdata(sd);
 
index 254c50f..7dbd5a9 100644 (file)
@@ -415,42 +415,34 @@ static int cx18_g_chip_ident(struct file *file, void *fh,
 }
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg)
-{
-       struct v4l2_dbg_register *regs = arg;
-
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-       if (regs->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE)
-               return -EINVAL;
-
-       regs->size = 4;
-       if (cmd == VIDIOC_DBG_S_REGISTER)
-               cx18_write_enc(cx, regs->val, regs->reg);
-       else
-               regs->val = cx18_read_enc(cx, regs->reg);
-       return 0;
-}
-
 static int cx18_g_register(struct file *file, void *fh,
                                struct v4l2_dbg_register *reg)
 {
        struct cx18 *cx = fh2id(fh)->cx;
 
-       if (v4l2_chip_match_host(&reg->match))
-               return cx18_cxc(cx, VIDIOC_DBG_G_REGISTER, reg);
+       if (v4l2_chip_match_host(&reg->match)) {
+               if (reg->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE)
+                       return -EINVAL;
+               reg->size = 4;
+               reg->val = cx18_read_enc(cx, reg->reg);
+               return 0;
+       }
        /* FIXME - errors shouldn't be ignored */
        cx18_call_all(cx, core, g_register, reg);
        return 0;
 }
 
 static int cx18_s_register(struct file *file, void *fh,
-                               struct v4l2_dbg_register *reg)
+                               const struct v4l2_dbg_register *reg)
 {
        struct cx18 *cx = fh2id(fh)->cx;
 
-       if (v4l2_chip_match_host(&reg->match))
-               return cx18_cxc(cx, VIDIOC_DBG_S_REGISTER, reg);
+       if (v4l2_chip_match_host(&reg->match)) {
+               if (reg->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE)
+                       return -EINVAL;
+               cx18_write_enc(cx, reg->val, reg->reg);
+               return 0;
+       }
        /* FIXME - errors shouldn't be ignored */
        cx18_call_all(cx, core, s_register, reg);
        return 0;
index ea9a614..acdb6d5 100644 (file)
@@ -158,18 +158,17 @@ int cx23885_g_register(struct file *file, void *fh,
 }
 
 static int cx23885_s_host_register(struct cx23885_dev *dev,
-                                  struct v4l2_dbg_register *reg)
+                                  const struct v4l2_dbg_register *reg)
 {
        if ((reg->reg & 0x3) != 0 || reg->reg >= pci_resource_len(dev->pci, 0))
                return -EINVAL;
 
-       reg->size = 4;
        cx_write(reg->reg, reg->val);
        return 0;
 }
 
 static int cx23417_s_register(struct cx23885_dev *dev,
-                             struct v4l2_dbg_register *reg)
+                             const struct v4l2_dbg_register *reg)
 {
        if (dev->v4l_device == NULL)
                return -EINVAL;
@@ -179,13 +178,11 @@ static int cx23417_s_register(struct cx23885_dev *dev,
 
        if (mc417_register_write(dev, (u16) reg->reg, (u32) reg->val))
                return -EINVAL; /* V4L2 spec, but -EREMOTEIO really */
-
-       reg->size = 4;
        return 0;
 }
 
 int cx23885_s_register(struct file *file, void *fh,
-                      struct v4l2_dbg_register *reg)
+                      const struct v4l2_dbg_register *reg)
 {
        struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;
 
index 315be0c..a608096 100644 (file)
@@ -33,7 +33,7 @@ int cx23885_g_register(struct file *file, void *fh,
 
 
 int cx23885_s_register(struct file *file, void *fh,
-                      struct v4l2_dbg_register *reg);
+                      const struct v4l2_dbg_register *reg);
 
 #endif
 #endif
index d51eed0..fa672fe 100644 (file)
@@ -1124,7 +1124,7 @@ static int cx23888_ir_g_register(struct v4l2_subdev *sd,
 }
 
 static int cx23888_ir_s_register(struct v4l2_subdev *sd,
-                                struct v4l2_dbg_register *reg)
+                                const struct v4l2_dbg_register *reg)
 {
        struct cx23888_ir_state *state = to_state(sd);
        u32 addr = CX23888_IR_REG_BASE + (u32) reg->reg;
index 93c7d57..1465591 100644 (file)
@@ -1364,7 +1364,7 @@ int cx25821_vidioc_g_register(struct file *file, void *fh,
 }
 
 int cx25821_vidioc_s_register(struct file *file, void *fh,
-                     struct v4l2_dbg_register *reg)
+                     const struct v4l2_dbg_register *reg)
 {
        struct cx25821_dev *dev = ((struct cx25821_fh *)fh)->dev;
 
index 239f63c..11ba5eb 100644 (file)
@@ -155,7 +155,7 @@ extern int cx25821_vidioc_s_frequency(struct file *file, void *priv,
 extern int cx25821_vidioc_g_register(struct file *file, void *fh,
                                     struct v4l2_dbg_register *reg);
 extern int cx25821_vidioc_s_register(struct file *file, void *fh,
-                                    struct v4l2_dbg_register *reg);
+                                    const struct v4l2_dbg_register *reg);
 extern int cx25821_vidioc_g_tuner(struct file *file, void *priv,
                                  struct v4l2_tuner *t);
 extern int cx25821_vidioc_s_tuner(struct file *file, void *priv,
index ead5be5..e3f6181 100644 (file)
@@ -1380,7 +1380,7 @@ static int vidioc_g_register (struct file *file, void *fh,
 }
 
 static int vidioc_s_register (struct file *file, void *fh,
-                               struct v4l2_dbg_register *reg)
+                               const struct v4l2_dbg_register *reg)
 {
        struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
 
index 861e462..50379b2 100644 (file)
@@ -748,12 +748,15 @@ static int ivtv_g_register(struct file *file, void *fh, struct v4l2_dbg_register
        return 0;
 }
 
-static int ivtv_s_register(struct file *file, void *fh, struct v4l2_dbg_register *reg)
+static int ivtv_s_register(struct file *file, void *fh, const struct v4l2_dbg_register *reg)
 {
        struct ivtv *itv = fh2id(fh)->itv;
 
-       if (v4l2_chip_match_host(&reg->match))
-               return ivtv_itvc(itv, false, reg->reg, &reg->val);
+       if (v4l2_chip_match_host(&reg->match)) {
+               u64 val = reg->val;
+
+               return ivtv_itvc(itv, false, reg->reg, &val);
+       }
        /* TODO: subdev errors should not be ignored, this should become a
           subdev helper function. */
        ivtv_call_all(itv, core, s_register, reg);
index a6c69a4..1363e97 100644 (file)
@@ -2300,7 +2300,7 @@ static int vidioc_g_register (struct file *file, void *priv,
 }
 
 static int vidioc_s_register (struct file *file, void *priv,
-                               struct v4l2_dbg_register *reg)
+                               const struct v4l2_dbg_register *reg)
 {
        struct saa7134_fh *fh = priv;
        struct saa7134_dev *dev = fh->dev;
index 9dd044b..71e8bea 100644 (file)
@@ -680,7 +680,7 @@ static int vidioc_g_register(struct file *file, void *fh, struct v4l2_dbg_regist
        return 0;
 }
 
-static int vidioc_s_register(struct file *file, void *fh, struct v4l2_dbg_register *reg)
+static int vidioc_s_register(struct file *file, void *fh, const struct v4l2_dbg_register *reg)
 {
        struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
 
@@ -688,7 +688,6 @@ static int vidioc_s_register(struct file *file, void *fh, struct v4l2_dbg_regist
                return -EPERM;
        if (v4l2_chip_match_host(&reg->match)) {
                saa7146_write(dev, reg->reg, reg->val);
-               reg->size = 4;
                return 0;
        }
        return call_all(dev, core, s_register, reg);
index 538de52..0b74fb2 100644 (file)
@@ -1313,7 +1313,7 @@ static int saa7164_g_register(struct file *file, void *fh,
 }
 
 static int saa7164_s_register(struct file *file, void *fh,
-                             struct v4l2_dbg_register *reg)
+                             const struct v4l2_dbg_register *reg)
 {
        struct saa7164_port *port = ((struct saa7164_encoder_fh *)fh)->port;
        struct saa7164_dev *dev = port->dev;
index 96f6a49..0e55b08 100644 (file)
@@ -890,7 +890,7 @@ static int bcap_dbg_g_register(struct file *file, void *priv,
 }
 
 static int bcap_dbg_s_register(struct file *file, void *priv,
-               struct v4l2_dbg_register *reg)
+               const struct v4l2_dbg_register *reg)
 {
        struct bcap_device *bcap_dev = video_drvdata(file);
 
index bcf0ada..1802f11 100644 (file)
@@ -1597,7 +1597,7 @@ static int vpbe_display_g_register(struct file *file, void *priv,
 }
 
 static int vpbe_display_s_register(struct file *file, void *priv,
-                       struct v4l2_dbg_register *reg)
+                       const struct v4l2_dbg_register *reg)
 {
        return 0;
 }
index 00b7f9c..5f98df1 100644 (file)
@@ -1924,7 +1924,8 @@ static int vpif_dbg_g_register(struct file *file, void *priv,
  * Returns zero or -EINVAL if write operations fails.
  */
 static int vpif_dbg_s_register(struct file *file, void *priv,
-               struct v4l2_dbg_register *reg){
+               const struct v4l2_dbg_register *reg)
+{
        struct vpif_fh *fh = priv;
        struct channel_obj *ch = fh->channel;
 
index f1dff9e..1b3fb5c 100644 (file)
@@ -1568,7 +1568,8 @@ static int vpif_dbg_g_register(struct file *file, void *priv,
  * Returns zero or -EINVAL if write operations fails.
  */
 static int vpif_dbg_s_register(struct file *file, void *priv,
-               struct v4l2_dbg_register *reg){
+               const struct v4l2_dbg_register *reg)
+{
        struct vpif_fh *fh = priv;
        struct channel_obj *ch = fh->channel;
 
index 76a8623..64ab91e 100644 (file)
@@ -1445,7 +1445,7 @@ static int mcam_vidioc_g_register(struct file *file, void *priv,
 }
 
 static int mcam_vidioc_s_register(struct file *file, void *priv,
-               struct v4l2_dbg_register *reg)
+               const struct v4l2_dbg_register *reg)
 {
        struct mcam_camera *cam = priv;
 
index 8e3b95a..7d02350 100644 (file)
@@ -1266,7 +1266,7 @@ static int sh_vou_g_register(struct file *file, void *fh,
 }
 
 static int sh_vou_s_register(struct file *file, void *fh,
-                                struct v4l2_dbg_register *reg)
+                                const struct v4l2_dbg_register *reg)
 {
        struct sh_vou_device *vou_dev = video_drvdata(file);
 
index 3592968..bf55abf 100644 (file)
@@ -1042,7 +1042,7 @@ static int soc_camera_g_register(struct file *file, void *fh,
 }
 
 static int soc_camera_s_register(struct file *file, void *fh,
-                                struct v4l2_dbg_register *reg)
+                                const struct v4l2_dbg_register *reg)
 {
        struct soc_camera_device *icd = file->private_data;
        struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
index e9dd01c..79f1d51 100644 (file)
@@ -1754,7 +1754,7 @@ static int vidioc_g_register(struct file *file, void *priv,
 }
 
 static int vidioc_s_register(struct file *file, void *priv,
-                            struct v4l2_dbg_register *reg)
+                            const struct v4l2_dbg_register *reg)
 {
        struct au0828_fh *fh = priv;
        struct au0828_dev *dev = fh->dev;
index 4cff2f4..cd22147 100644 (file)
@@ -1404,7 +1404,7 @@ int cx231xx_g_register(struct file *file, void *priv,
 }
 
 int cx231xx_s_register(struct file *file, void *priv,
-                            struct v4l2_dbg_register *reg)
+                            const struct v4l2_dbg_register *reg)
 {
        struct cx231xx_fh *fh = priv;
        struct cx231xx *dev = fh->dev;
index 2f9faee..5ad9fd6 100644 (file)
@@ -949,7 +949,7 @@ int cx231xx_g_chip_ident(struct file *file, void *fh, struct v4l2_dbg_chip_ident
 int cx231xx_g_register(struct file *file, void *priv,
                             struct v4l2_dbg_register *reg);
 int cx231xx_s_register(struct file *file, void *priv,
-                            struct v4l2_dbg_register *reg);
+                            const struct v4l2_dbg_register *reg);
 
 /* Provided by cx231xx-cards.c */
 extern void cx231xx_pre_card_setup(struct cx231xx *dev);
index 96d84c2..d09b5c0 100644 (file)
@@ -1323,7 +1323,7 @@ static int vidioc_g_register(struct file *file, void *priv,
 }
 
 static int vidioc_s_register(struct file *file, void *priv,
-                            struct v4l2_dbg_register *reg)
+                            const struct v4l2_dbg_register *reg)
 {
        struct em28xx_fh      *fh  = priv;
        struct em28xx         *dev = fh->dev;
index 924e032..5995ec4 100644 (file)
@@ -1039,7 +1039,7 @@ static int vidioc_g_register(struct file *file, void *priv,
 }
 
 static int vidioc_s_register(struct file *file, void *priv,
-                       struct v4l2_dbg_register *reg)
+                       const struct v4l2_dbg_register *reg)
 {
        struct gspca_dev *gspca_dev = video_drvdata(file);
 
index c3af321..ef8efeb 100644 (file)
@@ -74,8 +74,10 @@ typedef int (*cam_get_jpg_op) (struct gspca_dev *,
                                struct v4l2_jpegcompression *);
 typedef int (*cam_set_jpg_op) (struct gspca_dev *,
                                const struct v4l2_jpegcompression *);
-typedef int (*cam_reg_op) (struct gspca_dev *,
+typedef int (*cam_get_reg_op) (struct gspca_dev *,
                                struct v4l2_dbg_register *);
+typedef int (*cam_set_reg_op) (struct gspca_dev *,
+                               const struct v4l2_dbg_register *);
 typedef int (*cam_ident_op) (struct gspca_dev *,
                                struct v4l2_dbg_chip_ident *);
 typedef void (*cam_streamparm_op) (struct gspca_dev *,
@@ -108,8 +110,8 @@ struct sd_desc {
        cam_streamparm_op get_streamparm;
        cam_streamparm_op set_streamparm;
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-       cam_reg_op set_register;
-       cam_reg_op get_register;
+       cam_set_reg_op set_register;
+       cam_get_reg_op get_register;
 #endif
        cam_ident_op get_chip_ident;
 #if IS_ENABLED(CONFIG_INPUT)
index 682ef33..6008c8d 100644 (file)
@@ -840,7 +840,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int sd_dbg_s_register(struct gspca_dev *gspca_dev,
-                       struct v4l2_dbg_register *reg)
+                       const struct v4l2_dbg_register *reg)
 {
        u8 index;
        u8 value;
index 4ec544f..ead9a1f 100644 (file)
@@ -1598,7 +1598,7 @@ static int sd_dbg_g_register(struct gspca_dev *gspca_dev,
 }
 
 static int sd_dbg_s_register(struct gspca_dev *gspca_dev,
-                       struct v4l2_dbg_register *reg)
+                       const struct v4l2_dbg_register *reg)
 {
        struct sd *sd = (struct sd *) gspca_dev;
 
index 299751a..e11267f 100644 (file)
@@ -5165,7 +5165,7 @@ static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
 
 
 int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
-                            struct v4l2_dbg_match *match, u64 reg_id,
+                            const struct v4l2_dbg_match *match, u64 reg_id,
                             int setFl, u64 *val_ptr)
 {
 #ifdef CONFIG_VIDEO_ADV_DEBUG
index 8060fc6..91bae93 100644 (file)
@@ -240,7 +240,7 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *,
    setFl   - true to set the register, false to read it
    val_ptr - storage location for source / result. */
 int pvr2_hdw_register_access(struct pvr2_hdw *,
-                            struct v4l2_dbg_match *match, u64 reg_id,
+                            const struct v4l2_dbg_match *match, u64 reg_id,
                             int setFl, u64 *val_ptr);
 
 /* The following entry points are all lower level things you normally don't
index a7774e3..a8a65fa 100644 (file)
@@ -815,7 +815,7 @@ static int pvr2_g_register(struct file *file, void *priv, struct v4l2_dbg_regist
        return ret;
 }
 
-static int pvr2_s_register(struct file *file, void *priv, struct v4l2_dbg_register *req)
+static int pvr2_s_register(struct file *file, void *priv, const struct v4l2_dbg_register *req)
 {
        struct pvr2_v4l2_fh *fh = file->private_data;
        struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
index f6a6cdc..c4c723b 100644 (file)
@@ -500,7 +500,7 @@ static int vidioc_g_register(struct file *file, void *priv,
 }
 
 static int vidioc_s_register(struct file *file, void *priv,
-                            struct v4l2_dbg_register *reg)
+                            const struct v4l2_dbg_register *reg)
 {
        struct stk1160 *dev = video_drvdata(file);
 
index 041f19e..d34c2af 100644 (file)
@@ -483,7 +483,7 @@ static int vidioc_g_register(struct file *file, void *priv,
 }
 
 static int vidioc_s_register(struct file *file, void *priv,
-                               struct v4l2_dbg_register *reg)
+                               const struct v4l2_dbg_register *reg)
 {
        struct usb_usbvision *usbvision = video_drvdata(file);
        int err_code;
index 29c751d..936ca25 100644 (file)
@@ -1813,7 +1813,7 @@ static int v4l_dbg_s_register(const struct v4l2_ioctl_ops *ops,
                                struct file *file, void *fh, void *arg)
 {
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-       struct v4l2_dbg_register *p = arg;
+       const struct v4l2_dbg_register *p = arg;
 
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
index ee7b7c6..a4175cd 100644 (file)
@@ -242,7 +242,7 @@ struct v4l2_ioctl_ops {
        int (*vidioc_g_register)       (struct file *file, void *fh,
                                        struct v4l2_dbg_register *reg);
        int (*vidioc_s_register)       (struct file *file, void *fh,
-                                       struct v4l2_dbg_register *reg);
+                                       const struct v4l2_dbg_register *reg);
 #endif
        int (*vidioc_g_chip_ident)     (struct file *file, void *fh,
                                        struct v4l2_dbg_chip_ident *chip);
index 79784fc..8158a08 100644 (file)
@@ -165,7 +165,7 @@ struct v4l2_subdev_core_ops {
        long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
 #ifdef CONFIG_VIDEO_ADV_DEBUG
        int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
-       int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
+       int (*s_register)(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg);
 #endif
        int (*s_power)(struct v4l2_subdev *sd, int on);
        int (*interrupt_service_routine)(struct v4l2_subdev *sd,