Skip to content

Commit

Permalink
[media] v4l2: add const to argument of write-only s_tuner ioctl
Browse files Browse the repository at this point in the history
This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 24, 2013
1 parent b530a44 commit 2f73c7c
Show file tree
Hide file tree
Showing 51 changed files with 68 additions and 75 deletions.
2 changes: 1 addition & 1 deletion drivers/media/i2c/cx25840/cx25840-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1881,7 +1881,7 @@ static int cx25840_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
return 0;
}

static int cx25840_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
static int cx25840_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct cx25840_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/i2c/msp3400-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ static int msp_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
return 0;
}

static int msp_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
static int msp_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct msp_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/i2c/saa6588.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ static int saa6588_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
return 0;
}

static int saa6588_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
static int saa6588_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct saa6588 *s = to_saa6588(sd);

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/i2c/saa717x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ static int saa717x_s_stream(struct v4l2_subdev *sd, int enable)
}

/* change audio mode */
static int saa717x_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
static int saa717x_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct saa717x_state *decoder = to_state(sd);
int audio_mode;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/i2c/tda9840.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static int tda9840_status(struct v4l2_subdev *sd)
return byte & 0x60;
}

static int tda9840_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *t)
static int tda9840_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *t)
{
int stat = tda9840_status(sd);
int byte;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/i2c/tvaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,7 @@ static int tvaudio_s_routing(struct v4l2_subdev *sd,
return 0;
}

static int tvaudio_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
static int tvaudio_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct CHIPSTATE *chip = to_state(sd);
struct CHIPDESC *desc = chip->desc;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/i2c/vp27smpx.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static int vp27smpx_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
return 0;
}

static int vp27smpx_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
static int vp27smpx_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct vp27smpx_state *state = to_state(sd);

Expand Down
11 changes: 7 additions & 4 deletions drivers/media/pci/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,7 @@ static int bttv_s_input(struct file *file, void *priv, unsigned int i)
}

static int bttv_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *t)
const struct v4l2_tuner *t)
{
struct bttv_fh *fh = priv;
struct bttv *btv = fh->btv;
Expand All @@ -1830,8 +1830,11 @@ static int bttv_s_tuner(struct file *file, void *priv,

bttv_call_all(btv, tuner, s_tuner, t);

if (btv->audio_mode_gpio)
btv->audio_mode_gpio(btv, t, 1);
if (btv->audio_mode_gpio) {
struct v4l2_tuner copy = *t;

btv->audio_mode_gpio(btv, &copy, 1);
}
return 0;
}

Expand Down Expand Up @@ -3279,7 +3282,7 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
}

static int radio_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *t)
const struct v4l2_tuner *t)
{
struct bttv_fh *fh = priv;
struct bttv *btv = fh->btv;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx18/cx18-av-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ static int cx18_av_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
return 0;
}

static int cx18_av_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
static int cx18_av_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct cx18_av_state *state = to_cx18_av_state(sd);
struct cx18 *cx = v4l2_get_subdevdata(sd);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx18/cx18-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
return 0;
}

static int cx18_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
static int cx18_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *vt)
{
struct cx18_open_id *id = fh2id(fh);
struct cx18 *cx = id->cx;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx23885/cx23885-417.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,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 cx23885_fh *fh = file->private_data;
struct cx23885_dev *dev = fh->dev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx23885/cx23885-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,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 cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev;

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx25821/cx25821-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ int cx25821_vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
return 0;
}

int cx25821_vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
int cx25821_vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *t)
{
struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
struct cx25821_fh *fh = priv;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx25821/cx25821-video.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ extern int cx25821_vidioc_s_register(struct file *file, void *fh,
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,
struct v4l2_tuner *t);
const struct v4l2_tuner *t);

extern int cx25821_is_valid_width(u32 width, v4l2_std_id tvnorm);
extern int cx25821_is_valid_height(u32 height, v4l2_std_id tvnorm);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx88/cx88-blackbird.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,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 cx8802_fh *)priv)->dev->core;

Expand Down
9 changes: 2 additions & 7 deletions drivers/media/pci/cx88/cx88-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -1409,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;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/ivtv/ivtv-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static int subdev_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
return 0;
}

static int subdev_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
static int subdev_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct ivtv *itv = sd_to_ivtv(sd);
u16 mask, data;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/ivtv/ivtv-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ static int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std)
return 0;
}

static int ivtv_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
static int ivtv_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *vt)
{
struct ivtv_open_id *id = fh2id(fh);
struct ivtv *itv = id->itv;
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/saa7134/saa7134-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -2023,7 +2023,7 @@ static int saa7134_g_tuner(struct file *file, void *priv,
}

static int saa7134_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *t)
const struct v4l2_tuner *t)
{
struct saa7134_fh *fh = priv;
struct saa7134_dev *dev = fh->dev;
Expand Down Expand Up @@ -2347,7 +2347,7 @@ static int radio_g_tuner(struct file *file, void *priv,
return 0;
}
static int radio_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *t)
const struct v4l2_tuner *t)
{
struct saa7134_fh *fh = file->private_data;
struct saa7134_dev *dev = fh->dev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/saa7146/mxb.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *t)
return call_all(dev, tuner, g_tuner, t);
}

static int vidioc_s_tuner(struct file *file, void *fh, struct v4l2_tuner *t)
static int vidioc_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *t)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct mxb *mxb = (struct mxb *)dev->ext_priv;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/saa7164/saa7164-encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,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)
{
/* Update the A/V core */
return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/saa7164/saa7164-vbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,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)
{
/* Update the A/V core */
return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/ttpci/av7110_v4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *t)
return 0;
}

static int vidioc_s_tuner(struct file *file, void *fh, struct v4l2_tuner *t)
static int vidioc_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *t)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct av7110 *av7110 = (struct av7110 *)dev->ext_priv;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/dsbr100.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}

static int vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
const struct v4l2_tuner *v)
{
return v->index ? -EINVAL : 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/radio-cadet.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}

static int vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
const struct v4l2_tuner *v)
{
return v->index ? -EINVAL : 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/radio-isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static int radio_isa_g_tuner(struct file *file, void *priv,
}

static int radio_isa_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
const struct v4l2_tuner *v)
{
struct radio_isa_card *isa = video_drvdata(file);
const struct radio_isa_ops *ops = isa->drv->ops;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/radio-ma901.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,

/* vidioc_s_tuner - set tuner attributes */
static int vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
const struct v4l2_tuner *v)
{
struct ma901radio_device *radio = video_drvdata(file);

Expand Down
8 changes: 5 additions & 3 deletions drivers/media/radio/radio-miropcm20.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,18 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}

static int vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
const struct v4l2_tuner *v)
{
struct pcm20 *dev = video_drvdata(file);

if (v->index)
return -EINVAL;
if (v->audmode > V4L2_TUNER_MODE_STEREO)
v->audmode = V4L2_TUNER_MODE_STEREO;
dev->audmode = V4L2_TUNER_MODE_STEREO;
else
dev->audmode = v->audmode;
snd_aci_cmd(dev->aci, ACI_SET_TUNERMONO,
v->audmode == V4L2_TUNER_MODE_MONO, -1);
dev->audmode == V4L2_TUNER_MODE_MONO, -1);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/radio-mr800.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,

/* vidioc_s_tuner - set tuner attributes */
static int vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
const struct v4l2_tuner *v)
{
struct amradio_device *radio = video_drvdata(file);

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/radio-sf16fmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}

static int vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
const struct v4l2_tuner *v)
{
return v->index ? -EINVAL : 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/radio-tea5764.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}

static int vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
const struct v4l2_tuner *v)
{
struct tea5764_device *radio = video_drvdata(file);

Expand Down
7 changes: 3 additions & 4 deletions drivers/media/radio/radio-tea5777.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,18 +336,17 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}

static int vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
const struct v4l2_tuner *v)
{
struct radio_tea5777 *tea = video_drvdata(file);
u32 orig_audmode = tea->audmode;

if (v->index)
return -EINVAL;

if (v->audmode > V4L2_TUNER_MODE_STEREO)
v->audmode = V4L2_TUNER_MODE_STEREO;

tea->audmode = v->audmode;
if (tea->audmode > V4L2_TUNER_MODE_STEREO)
tea->audmode = V4L2_TUNER_MODE_STEREO;

if (tea->audmode != orig_audmode && tea->band == BAND_FM)
return radio_tea5777_set_freq(tea);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/radio-timb.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static int timbradio_vidioc_g_tuner(struct file *file, void *priv,
}

static int timbradio_vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
const struct v4l2_tuner *v)
{
struct timbradio *tr = video_drvdata(file);
return v4l2_subdev_call(tr->sd_tuner, tuner, s_tuner, v);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/radio-wl1273.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ static int wl1273_fm_vidioc_g_tuner(struct file *file, void *priv,
}

static int wl1273_fm_vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *tuner)
const struct v4l2_tuner *tuner)
{
struct wl1273_device *radio = video_get_drvdata(video_devdata(file));
struct wl1273_core *core = radio->core;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/si470x/radio-si470x-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
* si470x_vidioc_s_tuner - set tuner attributes
*/
static int si470x_vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *tuner)
const struct v4l2_tuner *tuner)
{
struct si470x_device *radio = video_drvdata(file);

Expand Down
Loading

0 comments on commit 2f73c7c

Please sign in to comment.