Skip to content

Commit

Permalink
[media] v4l2: make vidioc_s_audio const
Browse files Browse the repository at this point in the history
Write-only ioctls should have a const argument in the ioctl op.
Do this conversion for vidioc_s_audio.
Adding const for write-only ioctls was decided during the 2012 Media Workshop.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Sep 26, 2012
1 parent 85f5fe3 commit 0e8025b
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions drivers/media/pci/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3076,7 +3076,7 @@ static int bttv_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
return 0;
}

static int bttv_s_audio(struct file *file, void *priv, struct v4l2_audio *a)
static int bttv_s_audio(struct file *file, void *priv, const struct v4l2_audio *a)
{
if (unlikely(a->index))
return -EINVAL;
Expand Down Expand Up @@ -3480,7 +3480,7 @@ static int radio_s_tuner(struct file *file, void *priv,
}

static int radio_s_audio(struct file *file, void *priv,
struct v4l2_audio *a)
const struct v4l2_audio *a)
{
if (unlikely(a->index))
return -EINVAL;
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 @@ -492,7 +492,7 @@ static int cx18_g_audio(struct file *file, void *fh, struct v4l2_audio *vin)
return cx18_get_audio_input(cx, vin->index, vin);
}

static int cx18_s_audio(struct file *file, void *fh, struct v4l2_audio *vout)
static int cx18_s_audio(struct file *file, void *fh, const struct v4l2_audio *vout)
{
struct cx18 *cx = fh2id(fh)->cx;

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 @@ -1426,7 +1426,7 @@ static int vidioc_g_audinput(struct file *file, void *priv,
}

static int vidioc_s_audinput(struct file *file, void *priv,
struct v4l2_audio *i)
const struct v4l2_audio *i)
{
struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev;
if (i->index >= 2)
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 @@ -784,7 +784,7 @@ static int ivtv_g_audio(struct file *file, void *fh, struct v4l2_audio *vin)
return ivtv_get_audio_input(itv, vin->index, vin);
}

static int ivtv_s_audio(struct file *file, void *fh, struct v4l2_audio *vout)
static int ivtv_s_audio(struct file *file, void *fh, const struct v4l2_audio *vout)
{
struct ivtv *itv = fh2id(fh)->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 @@ -2089,7 +2089,7 @@ static int saa7134_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
return 0;
}

static int saa7134_s_audio(struct file *file, void *priv, struct v4l2_audio *a)
static int saa7134_s_audio(struct file *file, void *priv, const struct v4l2_audio *a)
{
return 0;
}
Expand Down Expand Up @@ -2373,7 +2373,7 @@ static int radio_g_audio(struct file *file, void *priv,
}

static int radio_s_audio(struct file *file, void *priv,
struct v4l2_audio *a)
const struct v4l2_audio *a)
{
return 0;
}
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 @@ -646,7 +646,7 @@ static int vidioc_g_audio(struct file *file, void *fh, struct v4l2_audio *a)
return 0;
}

static int vidioc_s_audio(struct file *file, void *fh, struct v4l2_audio *a)
static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)
{
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/ttpci/av7110_v4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ static int vidioc_g_audio(struct file *file, void *fh, struct v4l2_audio *a)
return 0;
}

static int vidioc_s_audio(struct file *file, void *fh, struct v4l2_audio *a)
static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)
{
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/radio-miropcm20.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static int vidioc_g_audio(struct file *file, void *priv,
}

static int vidioc_s_audio(struct file *file, void *priv,
struct v4l2_audio *a)
const struct v4l2_audio *a)
{
return a->index ? -EINVAL : 0;
}
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 @@ -239,7 +239,7 @@ static int vidioc_g_audio(struct file *file, void *priv,
}

static int vidioc_s_audio(struct file *file, void *priv,
struct v4l2_audio *a)
const struct v4l2_audio *a)
{
return a->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 @@ -448,7 +448,7 @@ static int vidioc_g_audio(struct file *file, void *priv,
}

static int vidioc_s_audio(struct file *file, void *priv,
struct v4l2_audio *a)
const struct v4l2_audio *a)
{
if (a->index != 0)
return -EINVAL;
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 @@ -85,7 +85,7 @@ static int timbradio_vidioc_g_audio(struct file *file, void *priv,
}

static int timbradio_vidioc_s_audio(struct file *file, void *priv,
struct v4l2_audio *a)
const struct v4l2_audio *a)
{
return a->index ? -EINVAL : 0;
}
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 @@ -1479,7 +1479,7 @@ static int wl1273_fm_vidioc_g_audio(struct file *file, void *priv,
}

static int wl1273_fm_vidioc_s_audio(struct file *file, void *priv,
struct v4l2_audio *audio)
const struct v4l2_audio *audio)
{
struct wl1273_device *radio = video_get_drvdata(video_devdata(file));

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

static int fm_v4l2_vidioc_s_audio(struct file *file, void *priv,
struct v4l2_audio *audio)
const struct v4l2_audio *audio)
{
if (audio->index != 0)
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/usb/au0828/au0828-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
return 0;
}

static int vidioc_s_audio(struct file *file, void *priv, struct v4l2_audio *a)
static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio *a)
{
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/usb/cx231xx/cx231xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
return 0;
}

static int vidioc_s_audio(struct file *file, void *priv, struct v4l2_audio *a)
static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio *a)
{
struct cx231xx_fh *fh = priv;
struct cx231xx *dev = fh->dev;
Expand Down Expand Up @@ -2096,7 +2096,7 @@ static int radio_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
return 0;
}

static int radio_s_audio(struct file *file, void *fh, struct v4l2_audio *a)
static int radio_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)
{
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/usb/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
return 0;
}

static int vidioc_s_audio(struct file *file, void *priv, struct v4l2_audio *a)
static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio *a)
{
struct em28xx_fh *fh = priv;
struct em28xx *dev = fh->dev;
Expand Down Expand Up @@ -2087,7 +2087,7 @@ static int radio_s_tuner(struct file *file, void *priv,
}

static int radio_s_audio(struct file *file, void *fh,
struct v4l2_audio *a)
const struct v4l2_audio *a)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/usb/hdpvr/hdpvr-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ static int vidioc_enumaudio(struct file *file, void *priv,
}

static int vidioc_s_audio(struct file *file, void *private_data,
struct v4l2_audio *audio)
const struct v4l2_audio *audio)
{
struct hdpvr_fh *fh = file->private_data;
struct hdpvr_device *dev = fh->dev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ static int pvr2_g_audio(struct file *file, void *priv, struct v4l2_audio *vin)
return 0;
}

static int pvr2_s_audio(struct file *file, void *priv, struct v4l2_audio *vout)
static int pvr2_s_audio(struct file *file, void *priv, const struct v4l2_audio *vout)
{
if (vout->index)
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/usb/tlg2300/pd-radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ static int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)
{
return vt->index > 0 ? -EINVAL : 0;
}
static int vidioc_s_audio(struct file *file, void *priv, struct v4l2_audio *va)
static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio *va)
{
return (va->index != 0) ? -EINVAL : 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/usb/tlg2300/pd-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ static int vidioc_g_audio(struct file *file, void *fh, struct v4l2_audio *a)
return 0;
}

static int vidioc_s_audio(struct file *file, void *fh, struct v4l2_audio *a)
static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)
{
return (0 == a->index) ? 0 : -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/usb/tm6000/tm6000-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ static int radio_g_audio(struct file *file, void *priv,
}

static int radio_s_audio(struct file *file, void *priv,
struct v4l2_audio *a)
const struct v4l2_audio *a)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/usb/usbvision/usbvision-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
}

static int vidioc_s_audio(struct file *file, void *fh,
struct v4l2_audio *a)
const struct v4l2_audio *a)
{
if (a->index)
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion include/media/v4l2-ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ struct v4l2_ioctl_ops {
int (*vidioc_g_audio) (struct file *file, void *fh,
struct v4l2_audio *a);
int (*vidioc_s_audio) (struct file *file, void *fh,
struct v4l2_audio *a);
const struct v4l2_audio *a);

/* Audio out ioctls */
int (*vidioc_enumaudout) (struct file *file, void *fh,
Expand Down

0 comments on commit 0e8025b

Please sign in to comment.