[media] v4l2: add const to argument of write-only s_register ioctl
[sfrench/cifs-2.6.git] / drivers / media / pci / cx88 / cx88-video.c
index bc78354262acae2dc90c877455c532a0120cd47a..e3f6181d1044846c8aa87e3e23525328a66b26d8 100644 (file)
@@ -1193,12 +1193,12 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *tvnorm)
        return 0;
 }
 
-static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *tvnorms)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id tvnorms)
 {
        struct cx88_core  *core = ((struct cx8800_fh *)priv)->dev->core;
 
        mutex_lock(&core->lock);
-       cx88_set_tvnorm(core,*tvnorms);
+       cx88_set_tvnorm(core, tvnorms);
        mutex_unlock(&core->lock);
 
        return 0;
@@ -1289,7 +1289,7 @@ static int vidioc_g_tuner (struct file *file, void *priv,
 }
 
 static int vidioc_s_tuner (struct file *file, void *priv,
-                               struct v4l2_tuner *t)
+                               const struct v4l2_tuner *t)
 {
        struct cx88_core  *core = ((struct cx8800_fh *)priv)->dev->core;
 
@@ -1321,8 +1321,10 @@ static int vidioc_g_frequency (struct file *file, void *priv,
 }
 
 int cx88_set_freq (struct cx88_core  *core,
-                               struct v4l2_frequency *f)
+                               const struct v4l2_frequency *f)
 {
+       struct v4l2_frequency new_freq = *f;
+
        if (unlikely(UNSET == core->board.tuner_type))
                return -EINVAL;
        if (unlikely(f->tuner != 0))
@@ -1331,8 +1333,8 @@ int cx88_set_freq (struct cx88_core  *core,
        mutex_lock(&core->lock);
        cx88_newstation(core);
        call_all(core, tuner, s_frequency, f);
-       call_all(core, tuner, g_frequency, f);
-       core->freq = f->frequency;
+       call_all(core, tuner, g_frequency, &new_freq);
+       core->freq = new_freq.frequency;
 
        /* When changing channels it is required to reset TVAUDIO */
        msleep (10);
@@ -1345,7 +1347,7 @@ int cx88_set_freq (struct cx88_core  *core,
 EXPORT_SYMBOL(cx88_set_freq);
 
 static int vidioc_s_frequency (struct file *file, void *priv,
-                               struct v4l2_frequency *f)
+                               const struct v4l2_frequency *f)
 {
        struct cx8800_fh  *fh   = priv;
        struct cx88_core  *core = fh->dev->core;
@@ -1378,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;
 
@@ -1407,20 +1409,15 @@ static int radio_g_tuner (struct file *file, void *priv,
        return 0;
 }
 
-/* FIXME: Should add a standard for radio */
-
 static int radio_s_tuner (struct file *file, void *priv,
-                               struct v4l2_tuner *t)
+                               const struct v4l2_tuner *t)
 {
        struct cx88_core  *core = ((struct cx8800_fh *)priv)->dev->core;
 
        if (0 != t->index)
                return -EINVAL;
-       if (t->audmode > V4L2_TUNER_MODE_STEREO)
-               t->audmode = V4L2_TUNER_MODE_STEREO;
 
        call_all(core, tuner, s_tuner, t);
-
        return 0;
 }