From: Mauro Carvalho Chehab Date: Tue, 21 Oct 2008 14:27:20 +0000 (-0300) Subject: V4L/DVB (9330): Get rid of inode parameter at v4l_compat_translate_ioctl() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b1f88407f3767f924cae1d521e815e568996a4ef;p=linux-beck.git V4L/DVB (9330): Get rid of inode parameter at v4l_compat_translate_ioctl() The inode parameter at v4l_compat_translate_ioctl() were just passed over several places just to keep compatible with fops.ioctl. However, it weren't used anywere. This patch gets hid of this unused parameter. Cc: Laurent Pinchart Cc: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c index 99be9e5c85f7..fe0bd55977e3 100644 --- a/drivers/media/common/saa7146_video.c +++ b/drivers/media/common/saa7146_video.c @@ -834,7 +834,7 @@ static int video_end(struct saa7146_fh *fh, struct file *file) * copying is done already, arg is a kernel pointer. */ -int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *arg) +static int __saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg) { struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; @@ -1215,12 +1215,18 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int } #endif default: - return v4l_compat_translate_ioctl(inode,file,cmd,arg, - saa7146_video_do_ioctl); + return v4l_compat_translate_ioctl(file, cmd, arg, + __saa7146_video_do_ioctl); } return 0; } +int saa7146_video_do_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, void *arg) +{ + return __saa7146_video_do_ioctl(file, cmd, arg); +} + /*********************************************************************************/ /* buffer handling functions */ diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 43ef7ba75c8b..97ed95957992 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -168,7 +168,7 @@ static const char *get_v4l_name(int v4l_type) * This is part of Video 4 Linux API. The procedure handles ioctl() calls. * */ -static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, +static int __pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) { struct pvr2_v4l2_fh *fh = file->private_data; @@ -863,8 +863,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, #endif default : - ret = v4l_compat_translate_ioctl(inode,file,cmd, - arg,pvr2_v4l2_do_ioctl); + ret = v4l_compat_translate_ioctl(file, cmd, + arg, __pvr2_v4l2_do_ioctl); } pvr2_hdw_commit_ctl(hdw); @@ -890,6 +890,11 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, return ret; } +static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, void *arg) +{ + return __pvr2_v4l2_do_ioctl(file, cmd, arg); +} static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip) { diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c index 78e4c4e09d89..758dfefaba8d 100644 --- a/drivers/media/video/uvc/uvc_v4l2.c +++ b/drivers/media/video/uvc/uvc_v4l2.c @@ -464,7 +464,7 @@ static int uvc_v4l2_release(struct inode *inode, struct file *file) return 0; } -static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file, +static int __uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) { struct video_device *vdev = video_devdata(file); @@ -978,8 +978,8 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file, return uvc_xu_ctrl_query(video, arg, 1); default: - if ((ret = v4l_compat_translate_ioctl(inode, file, cmd, arg, - uvc_v4l2_do_ioctl)) == -ENOIOCTLCMD) + if ((ret = v4l_compat_translate_ioctl(file, cmd, arg, + __uvc_v4l2_do_ioctl)) == -ENOIOCTLCMD) uvc_trace(UVC_TRACE_IOCTL, "Unknown ioctl 0x%08x\n", cmd); return ret; @@ -988,6 +988,12 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file, return ret; } +static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, void *arg) +{ + return __uvc_v4l2_do_ioctl(file, cmd, arg); +} + static int uvc_v4l2_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c index 928cb4037372..f13c0a9d684f 100644 --- a/drivers/media/video/v4l1-compat.c +++ b/drivers/media/video/v4l1-compat.c @@ -57,8 +57,7 @@ MODULE_LICENSE("GPL"); */ static int -get_v4l_control(struct inode *inode, - struct file *file, +get_v4l_control(struct file *file, int cid, v4l2_kioctl drv) { @@ -67,12 +66,12 @@ get_v4l_control(struct inode *inode, int err; qctrl2.id = cid; - err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2); + err = drv(file, VIDIOC_QUERYCTRL, &qctrl2); if (err < 0) dprintk("VIDIOC_QUERYCTRL: %d\n", err); if (err == 0 && !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) { ctrl2.id = qctrl2.id; - err = drv(inode, file, VIDIOC_G_CTRL, &ctrl2); + err = drv(file, VIDIOC_G_CTRL, &ctrl2); if (err < 0) { dprintk("VIDIOC_G_CTRL: %d\n", err); return 0; @@ -85,8 +84,7 @@ get_v4l_control(struct inode *inode, } static int -set_v4l_control(struct inode *inode, - struct file *file, +set_v4l_control(struct file *file, int cid, int value, v4l2_kioctl drv) @@ -96,7 +94,7 @@ set_v4l_control(struct inode *inode, int err; qctrl2.id = cid; - err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2); + err = drv(file, VIDIOC_QUERYCTRL, &qctrl2); if (err < 0) dprintk("VIDIOC_QUERYCTRL: %d\n", err); if (err == 0 && @@ -114,7 +112,7 @@ set_v4l_control(struct inode *inode, + 32767) / 65535; ctrl2.value += qctrl2.minimum; - err = drv(inode, file, VIDIOC_S_CTRL, &ctrl2); + err = drv(file, VIDIOC_S_CTRL, &ctrl2); if (err < 0) dprintk("VIDIOC_S_CTRL: %d\n", err); } @@ -222,7 +220,6 @@ static int poll_one(struct file *file, struct poll_wqueues *pwq) } static int count_inputs( - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -232,14 +229,13 @@ static int count_inputs( for (i = 0;; i++) { memset(&input2, 0, sizeof(input2)); input2.index = i; - if (0 != drv(inode, file, VIDIOC_ENUMINPUT, &input2)) + if (0 != drv(file, VIDIOC_ENUMINPUT, &input2)) break; } return i; } static int check_size( - struct inode *inode, struct file *file, v4l2_kioctl drv, int *maxw, @@ -252,14 +248,14 @@ static int check_size( memset(&fmt2, 0, sizeof(fmt2)); desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (0 != drv(inode, file, VIDIOC_ENUM_FMT, &desc2)) + if (0 != drv(file, VIDIOC_ENUM_FMT, &desc2)) goto done; fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fmt2.fmt.pix.width = 10000; fmt2.fmt.pix.height = 10000; fmt2.fmt.pix.pixelformat = desc2.pixelformat; - if (0 != drv(inode, file, VIDIOC_TRY_FMT, &fmt2)) + if (0 != drv(file, VIDIOC_TRY_FMT, &fmt2)) goto done; *maxw = fmt2.fmt.pix.width; @@ -273,7 +269,6 @@ done: static noinline int v4l1_compat_get_capabilities( struct video_capability *cap, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -289,13 +284,13 @@ static noinline int v4l1_compat_get_capabilities( memset(cap, 0, sizeof(*cap)); memset(&fbuf, 0, sizeof(fbuf)); - err = drv(inode, file, VIDIOC_QUERYCAP, cap2); + err = drv(file, VIDIOC_QUERYCAP, cap2); if (err < 0) { dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err); goto done; } if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) { - err = drv(inode, file, VIDIOC_G_FBUF, &fbuf); + err = drv(file, VIDIOC_G_FBUF, &fbuf); if (err < 0) { dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err); memset(&fbuf, 0, sizeof(fbuf)); @@ -317,8 +312,8 @@ static noinline int v4l1_compat_get_capabilities( if (fbuf.capability & V4L2_FBUF_CAP_LIST_CLIPPING) cap->type |= VID_TYPE_CLIPPING; - cap->channels = count_inputs(inode, file, drv); - check_size(inode, file, drv, + cap->channels = count_inputs(file, drv); + check_size(file, drv, &cap->maxwidth, &cap->maxheight); cap->audios = 0; /* FIXME */ cap->minwidth = 48; /* FIXME */ @@ -331,7 +326,6 @@ done: static noinline int v4l1_compat_get_frame_buffer( struct video_buffer *buffer, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -341,7 +335,7 @@ static noinline int v4l1_compat_get_frame_buffer( memset(buffer, 0, sizeof(*buffer)); memset(&fbuf, 0, sizeof(fbuf)); - err = drv(inode, file, VIDIOC_G_FBUF, &fbuf); + err = drv(file, VIDIOC_G_FBUF, &fbuf); if (err < 0) { dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err); goto done; @@ -386,7 +380,6 @@ done: static noinline int v4l1_compat_set_frame_buffer( struct video_buffer *buffer, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -415,7 +408,7 @@ static noinline int v4l1_compat_set_frame_buffer( break; } fbuf.fmt.bytesperline = buffer->bytesperline; - err = drv(inode, file, VIDIOC_S_FBUF, &fbuf); + err = drv(file, VIDIOC_S_FBUF, &fbuf); if (err < 0) dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err); return err; @@ -423,7 +416,6 @@ static noinline int v4l1_compat_set_frame_buffer( static noinline int v4l1_compat_get_win_cap_dimensions( struct video_window *win, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -438,7 +430,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions( memset(win, 0, sizeof(*win)); fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; - err = drv(inode, file, VIDIOC_G_FMT, fmt); + err = drv(file, VIDIOC_G_FMT, fmt); if (err < 0) dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err); if (err == 0) { @@ -453,7 +445,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions( } fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - err = drv(inode, file, VIDIOC_G_FMT, fmt); + err = drv(file, VIDIOC_G_FMT, fmt); if (err < 0) { dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err); goto done; @@ -472,7 +464,6 @@ done: static noinline int v4l1_compat_set_win_cap_dimensions( struct video_window *win, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -485,8 +476,8 @@ static noinline int v4l1_compat_set_win_cap_dimensions( return err; } fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - drv(inode, file, VIDIOC_STREAMOFF, &fmt->type); - err1 = drv(inode, file, VIDIOC_G_FMT, fmt); + drv(file, VIDIOC_STREAMOFF, &fmt->type); + err1 = drv(file, VIDIOC_G_FMT, fmt); if (err1 < 0) dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1); if (err1 == 0) { @@ -494,7 +485,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions( fmt->fmt.pix.height = win->height; fmt->fmt.pix.field = V4L2_FIELD_ANY; fmt->fmt.pix.bytesperline = 0; - err = drv(inode, file, VIDIOC_S_FMT, fmt); + err = drv(file, VIDIOC_S_FMT, fmt); if (err < 0) dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n", err); @@ -511,7 +502,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions( fmt->fmt.win.chromakey = win->chromakey; fmt->fmt.win.clips = (void __user *)win->clips; fmt->fmt.win.clipcount = win->clipcount; - err2 = drv(inode, file, VIDIOC_S_FMT, fmt); + err2 = drv(file, VIDIOC_S_FMT, fmt); if (err2 < 0) dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2); @@ -525,7 +516,6 @@ static noinline int v4l1_compat_set_win_cap_dimensions( static noinline int v4l1_compat_turn_preview_on_off( int *on, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -536,9 +526,9 @@ static noinline int v4l1_compat_turn_preview_on_off( /* dirty hack time. But v4l1 has no STREAMOFF * equivalent in the API, and this one at * least comes close ... */ - drv(inode, file, VIDIOC_STREAMOFF, &captype); + drv(file, VIDIOC_STREAMOFF, &captype); } - err = drv(inode, file, VIDIOC_OVERLAY, on); + err = drv(file, VIDIOC_OVERLAY, on); if (err < 0) dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err); return err; @@ -546,7 +536,6 @@ static noinline int v4l1_compat_turn_preview_on_off( static noinline int v4l1_compat_get_input_info( struct video_channel *chan, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -556,7 +545,7 @@ static noinline int v4l1_compat_get_input_info( memset(&input2, 0, sizeof(input2)); input2.index = chan->channel; - err = drv(inode, file, VIDIOC_ENUMINPUT, &input2); + err = drv(file, VIDIOC_ENUMINPUT, &input2); if (err < 0) { dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: " "channel=%d err=%d\n", chan->channel, err); @@ -578,7 +567,7 @@ static noinline int v4l1_compat_get_input_info( break; } chan->norm = 0; - err = drv(inode, file, VIDIOC_G_STD, &sid); + err = drv(file, VIDIOC_G_STD, &sid); if (err < 0) dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err); if (err == 0) { @@ -595,14 +584,13 @@ done: static noinline int v4l1_compat_set_input( struct video_channel *chan, - struct inode *inode, struct file *file, v4l2_kioctl drv) { int err; v4l2_std_id sid = 0; - err = drv(inode, file, VIDIOC_S_INPUT, &chan->channel); + err = drv(file, VIDIOC_S_INPUT, &chan->channel); if (err < 0) dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err); switch (chan->norm) { @@ -617,7 +605,7 @@ static noinline int v4l1_compat_set_input( break; } if (0 != sid) { - err = drv(inode, file, VIDIOC_S_STD, &sid); + err = drv(file, VIDIOC_S_STD, &sid); if (err < 0) dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err); } @@ -626,7 +614,6 @@ static noinline int v4l1_compat_set_input( static noinline int v4l1_compat_get_picture( struct video_picture *pict, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -639,19 +626,19 @@ static noinline int v4l1_compat_get_picture( return err; } - pict->brightness = get_v4l_control(inode, file, + pict->brightness = get_v4l_control(file, V4L2_CID_BRIGHTNESS, drv); - pict->hue = get_v4l_control(inode, file, + pict->hue = get_v4l_control(file, V4L2_CID_HUE, drv); - pict->contrast = get_v4l_control(inode, file, + pict->contrast = get_v4l_control(file, V4L2_CID_CONTRAST, drv); - pict->colour = get_v4l_control(inode, file, + pict->colour = get_v4l_control(file, V4L2_CID_SATURATION, drv); - pict->whiteness = get_v4l_control(inode, file, + pict->whiteness = get_v4l_control(file, V4L2_CID_WHITENESS, drv); fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - err = drv(inode, file, VIDIOC_G_FMT, fmt); + err = drv(file, VIDIOC_G_FMT, fmt); if (err < 0) { dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err); goto done; @@ -669,7 +656,6 @@ done: static noinline int v4l1_compat_set_picture( struct video_picture *pict, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -685,15 +671,15 @@ static noinline int v4l1_compat_set_picture( } memset(&fbuf, 0, sizeof(fbuf)); - set_v4l_control(inode, file, + set_v4l_control(file, V4L2_CID_BRIGHTNESS, pict->brightness, drv); - set_v4l_control(inode, file, + set_v4l_control(file, V4L2_CID_HUE, pict->hue, drv); - set_v4l_control(inode, file, + set_v4l_control(file, V4L2_CID_CONTRAST, pict->contrast, drv); - set_v4l_control(inode, file, + set_v4l_control(file, V4L2_CID_SATURATION, pict->colour, drv); - set_v4l_control(inode, file, + set_v4l_control(file, V4L2_CID_WHITENESS, pict->whiteness, drv); /* * V4L1 uses this ioctl to set both memory capture and overlay @@ -703,7 +689,7 @@ static noinline int v4l1_compat_set_picture( */ fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - err = drv(inode, file, VIDIOC_G_FMT, fmt); + err = drv(file, VIDIOC_G_FMT, fmt); /* If VIDIOC_G_FMT failed, then the driver likely doesn't support memory capture. Trying to set the memory capture parameters would be pointless. */ @@ -714,13 +700,13 @@ static noinline int v4l1_compat_set_picture( palette_to_pixelformat(pict->palette)) { fmt->fmt.pix.pixelformat = palette_to_pixelformat( pict->palette); - mem_err = drv(inode, file, VIDIOC_S_FMT, fmt); + mem_err = drv(file, VIDIOC_S_FMT, fmt); if (mem_err < 0) dprintk("VIDIOCSPICT / VIDIOC_S_FMT: %d\n", mem_err); } - err = drv(inode, file, VIDIOC_G_FBUF, &fbuf); + err = drv(file, VIDIOC_G_FBUF, &fbuf); /* If VIDIOC_G_FBUF failed, then the driver likely doesn't support overlay. Trying to set the overlay parameters would be quite pointless. */ @@ -731,7 +717,7 @@ static noinline int v4l1_compat_set_picture( palette_to_pixelformat(pict->palette)) { fbuf.fmt.pixelformat = palette_to_pixelformat( pict->palette); - ovl_err = drv(inode, file, VIDIOC_S_FBUF, &fbuf); + ovl_err = drv(file, VIDIOC_S_FBUF, &fbuf); if (ovl_err < 0) dprintk("VIDIOCSPICT / VIDIOC_S_FBUF: %d\n", ovl_err); @@ -752,7 +738,6 @@ static noinline int v4l1_compat_set_picture( static noinline int v4l1_compat_get_tuner( struct video_tuner *tun, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -762,7 +747,7 @@ static noinline int v4l1_compat_get_tuner( v4l2_std_id sid; memset(&tun2, 0, sizeof(tun2)); - err = drv(inode, file, VIDIOC_G_TUNER, &tun2); + err = drv(file, VIDIOC_G_TUNER, &tun2); if (err < 0) { dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err); goto done; @@ -778,7 +763,7 @@ static noinline int v4l1_compat_get_tuner( for (i = 0; i < 64; i++) { memset(&std2, 0, sizeof(std2)); std2.index = i; - if (0 != drv(inode, file, VIDIOC_ENUMSTD, &std2)) + if (0 != drv(file, VIDIOC_ENUMSTD, &std2)) break; if (std2.id & V4L2_STD_PAL) tun->flags |= VIDEO_TUNER_PAL; @@ -788,7 +773,7 @@ static noinline int v4l1_compat_get_tuner( tun->flags |= VIDEO_TUNER_SECAM; } - err = drv(inode, file, VIDIOC_G_STD, &sid); + err = drv(file, VIDIOC_G_STD, &sid); if (err < 0) dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err); if (err == 0) { @@ -811,7 +796,6 @@ done: static noinline int v4l1_compat_select_tuner( struct video_tuner *tun, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -821,7 +805,7 @@ static noinline int v4l1_compat_select_tuner( t.index = tun->tuner; - err = drv(inode, file, VIDIOC_S_INPUT, &t); + err = drv(file, VIDIOC_S_INPUT, &t); if (err < 0) dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err); return err; @@ -829,7 +813,6 @@ static noinline int v4l1_compat_select_tuner( static noinline int v4l1_compat_get_frequency( unsigned long *freq, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -838,7 +821,7 @@ static noinline int v4l1_compat_get_frequency( memset(&freq2, 0, sizeof(freq2)); freq2.tuner = 0; - err = drv(inode, file, VIDIOC_G_FREQUENCY, &freq2); + err = drv(file, VIDIOC_G_FREQUENCY, &freq2); if (err < 0) dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err); if (0 == err) @@ -848,7 +831,6 @@ static noinline int v4l1_compat_get_frequency( static noinline int v4l1_compat_set_frequency( unsigned long *freq, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -856,9 +838,9 @@ static noinline int v4l1_compat_set_frequency( struct v4l2_frequency freq2; memset(&freq2, 0, sizeof(freq2)); - drv(inode, file, VIDIOC_G_FREQUENCY, &freq2); + drv(file, VIDIOC_G_FREQUENCY, &freq2); freq2.frequency = *freq; - err = drv(inode, file, VIDIOC_S_FREQUENCY, &freq2); + err = drv(file, VIDIOC_S_FREQUENCY, &freq2); if (err < 0) dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err); return err; @@ -866,7 +848,6 @@ static noinline int v4l1_compat_set_frequency( static noinline int v4l1_compat_get_audio( struct video_audio *aud, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -876,7 +857,7 @@ static noinline int v4l1_compat_get_audio( struct v4l2_tuner tun2; memset(&aud2, 0, sizeof(aud2)); - err = drv(inode, file, VIDIOC_G_AUDIO, &aud2); + err = drv(file, VIDIOC_G_AUDIO, &aud2); if (err < 0) { dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err); goto done; @@ -886,27 +867,27 @@ static noinline int v4l1_compat_get_audio( aud->name[sizeof(aud->name) - 1] = 0; aud->audio = aud2.index; aud->flags = 0; - i = get_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME, drv); + i = get_v4l_control(file, V4L2_CID_AUDIO_VOLUME, drv); if (i >= 0) { aud->volume = i; aud->flags |= VIDEO_AUDIO_VOLUME; } - i = get_v4l_control(inode, file, V4L2_CID_AUDIO_BASS, drv); + i = get_v4l_control(file, V4L2_CID_AUDIO_BASS, drv); if (i >= 0) { aud->bass = i; aud->flags |= VIDEO_AUDIO_BASS; } - i = get_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE, drv); + i = get_v4l_control(file, V4L2_CID_AUDIO_TREBLE, drv); if (i >= 0) { aud->treble = i; aud->flags |= VIDEO_AUDIO_TREBLE; } - i = get_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE, drv); + i = get_v4l_control(file, V4L2_CID_AUDIO_BALANCE, drv); if (i >= 0) { aud->balance = i; aud->flags |= VIDEO_AUDIO_BALANCE; } - i = get_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE, drv); + i = get_v4l_control(file, V4L2_CID_AUDIO_MUTE, drv); if (i >= 0) { if (i) aud->flags |= VIDEO_AUDIO_MUTE; @@ -914,13 +895,13 @@ static noinline int v4l1_compat_get_audio( } aud->step = 1; qctrl2.id = V4L2_CID_AUDIO_VOLUME; - if (drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2) == 0 && + if (drv(file, VIDIOC_QUERYCTRL, &qctrl2) == 0 && !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) aud->step = qctrl2.step; aud->mode = 0; memset(&tun2, 0, sizeof(tun2)); - err = drv(inode, file, VIDIOC_G_TUNER, &tun2); + err = drv(file, VIDIOC_G_TUNER, &tun2); if (err < 0) { dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err); err = 0; @@ -939,7 +920,6 @@ done: static noinline int v4l1_compat_set_audio( struct video_audio *aud, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -951,24 +931,24 @@ static noinline int v4l1_compat_set_audio( memset(&tun2, 0, sizeof(tun2)); aud2.index = aud->audio; - err = drv(inode, file, VIDIOC_S_AUDIO, &aud2); + err = drv(file, VIDIOC_S_AUDIO, &aud2); if (err < 0) { dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err); goto done; } - set_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME, + set_v4l_control(file, V4L2_CID_AUDIO_VOLUME, aud->volume, drv); - set_v4l_control(inode, file, V4L2_CID_AUDIO_BASS, + set_v4l_control(file, V4L2_CID_AUDIO_BASS, aud->bass, drv); - set_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE, + set_v4l_control(file, V4L2_CID_AUDIO_TREBLE, aud->treble, drv); - set_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE, + set_v4l_control(file, V4L2_CID_AUDIO_BALANCE, aud->balance, drv); - set_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE, + set_v4l_control(file, V4L2_CID_AUDIO_MUTE, !!(aud->flags & VIDEO_AUDIO_MUTE), drv); - err = drv(inode, file, VIDIOC_G_TUNER, &tun2); + err = drv(file, VIDIOC_G_TUNER, &tun2); if (err < 0) dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err); if (err == 0) { @@ -985,7 +965,7 @@ static noinline int v4l1_compat_set_audio( tun2.audmode = V4L2_TUNER_MODE_LANG2; break; } - err = drv(inode, file, VIDIOC_S_TUNER, &tun2); + err = drv(file, VIDIOC_S_TUNER, &tun2); if (err < 0) dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err); } @@ -996,7 +976,6 @@ done: static noinline int v4l1_compat_capture_frame( struct video_mmap *mm, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -1013,7 +992,7 @@ static noinline int v4l1_compat_capture_frame( memset(&buf, 0, sizeof(buf)); fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - err = drv(inode, file, VIDIOC_G_FMT, fmt); + err = drv(file, VIDIOC_G_FMT, fmt); if (err < 0) { dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err); goto done; @@ -1029,7 +1008,7 @@ static noinline int v4l1_compat_capture_frame( palette_to_pixelformat(mm->format); fmt->fmt.pix.field = V4L2_FIELD_ANY; fmt->fmt.pix.bytesperline = 0; - err = drv(inode, file, VIDIOC_S_FMT, fmt); + err = drv(file, VIDIOC_S_FMT, fmt); if (err < 0) { dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err); goto done; @@ -1037,17 +1016,17 @@ static noinline int v4l1_compat_capture_frame( } buf.index = mm->frame; buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - err = drv(inode, file, VIDIOC_QUERYBUF, &buf); + err = drv(file, VIDIOC_QUERYBUF, &buf); if (err < 0) { dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err); goto done; } - err = drv(inode, file, VIDIOC_QBUF, &buf); + err = drv(file, VIDIOC_QBUF, &buf); if (err < 0) { dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err); goto done; } - err = drv(inode, file, VIDIOC_STREAMON, &captype); + err = drv(file, VIDIOC_STREAMON, &captype); if (err < 0) dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err); done: @@ -1057,7 +1036,6 @@ done: static noinline int v4l1_compat_sync( int *i, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -1069,7 +1047,7 @@ static noinline int v4l1_compat_sync( memset(&buf, 0, sizeof(buf)); buf.index = *i; buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - err = drv(inode, file, VIDIOC_QUERYBUF, &buf); + err = drv(file, VIDIOC_QUERYBUF, &buf); if (err < 0) { /* No such buffer */ dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); @@ -1082,7 +1060,7 @@ static noinline int v4l1_compat_sync( } /* make sure capture actually runs so we don't block forever */ - err = drv(inode, file, VIDIOC_STREAMON, &captype); + err = drv(file, VIDIOC_STREAMON, &captype); if (err < 0) { dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err); goto done; @@ -1096,7 +1074,7 @@ static noinline int v4l1_compat_sync( if (err < 0 || /* error or sleep was interrupted */ err == 0) /* timeout? Shouldn't occur. */ break; - err = drv(inode, file, VIDIOC_QUERYBUF, &buf); + err = drv(file, VIDIOC_QUERYBUF, &buf); if (err < 0) dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); } @@ -1104,7 +1082,7 @@ static noinline int v4l1_compat_sync( if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */ goto done; do { - err = drv(inode, file, VIDIOC_DQBUF, &buf); + err = drv(file, VIDIOC_DQBUF, &buf); if (err < 0) dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err); } while (err == 0 && buf.index != *i); @@ -1114,7 +1092,6 @@ done: static noinline int v4l1_compat_get_vbi_format( struct vbi_format *fmt, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -1128,7 +1105,7 @@ static noinline int v4l1_compat_get_vbi_format( } fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE; - err = drv(inode, file, VIDIOC_G_FMT, fmt2); + err = drv(file, VIDIOC_G_FMT, fmt2); if (err < 0) { dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err); goto done; @@ -1153,7 +1130,6 @@ done: static noinline int v4l1_compat_set_vbi_format( struct vbi_format *fmt, - struct inode *inode, struct file *file, v4l2_kioctl drv) { @@ -1179,7 +1155,7 @@ static noinline int v4l1_compat_set_vbi_format( fmt2->fmt.vbi.start[1] = fmt->start[1]; fmt2->fmt.vbi.count[1] = fmt->count[1]; fmt2->fmt.vbi.flags = fmt->flags; - err = drv(inode, file, VIDIOC_TRY_FMT, fmt2); + err = drv(file, VIDIOC_TRY_FMT, fmt2); if (err < 0) { dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err); goto done; @@ -1196,7 +1172,7 @@ static noinline int v4l1_compat_set_vbi_format( err = -EINVAL; goto done; } - err = drv(inode, file, VIDIOC_S_FMT, fmt2); + err = drv(file, VIDIOC_S_FMT, fmt2); if (err < 0) dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err); done: @@ -1208,8 +1184,7 @@ done: * This function is exported. */ int -v4l_compat_translate_ioctl(struct inode *inode, - struct file *file, +v4l_compat_translate_ioctl(struct file *file, int cmd, void *arg, v4l2_kioctl drv) @@ -1218,64 +1193,64 @@ v4l_compat_translate_ioctl(struct inode *inode, switch (cmd) { case VIDIOCGCAP: /* capability */ - err = v4l1_compat_get_capabilities(arg, inode, file, drv); + err = v4l1_compat_get_capabilities(arg, file, drv); break; case VIDIOCGFBUF: /* get frame buffer */ - err = v4l1_compat_get_frame_buffer(arg, inode, file, drv); + err = v4l1_compat_get_frame_buffer(arg, file, drv); break; case VIDIOCSFBUF: /* set frame buffer */ - err = v4l1_compat_set_frame_buffer(arg, inode, file, drv); + err = v4l1_compat_set_frame_buffer(arg, file, drv); break; case VIDIOCGWIN: /* get window or capture dimensions */ - err = v4l1_compat_get_win_cap_dimensions(arg, inode, file, drv); + err = v4l1_compat_get_win_cap_dimensions(arg, file, drv); break; case VIDIOCSWIN: /* set window and/or capture dimensions */ - err = v4l1_compat_set_win_cap_dimensions(arg, inode, file, drv); + err = v4l1_compat_set_win_cap_dimensions(arg, file, drv); break; case VIDIOCCAPTURE: /* turn on/off preview */ - err = v4l1_compat_turn_preview_on_off(arg, inode, file, drv); + err = v4l1_compat_turn_preview_on_off(arg, file, drv); break; case VIDIOCGCHAN: /* get input information */ - err = v4l1_compat_get_input_info(arg, inode, file, drv); + err = v4l1_compat_get_input_info(arg, file, drv); break; case VIDIOCSCHAN: /* set input */ - err = v4l1_compat_set_input(arg, inode, file, drv); + err = v4l1_compat_set_input(arg, file, drv); break; case VIDIOCGPICT: /* get tone controls & partial capture format */ - err = v4l1_compat_get_picture(arg, inode, file, drv); + err = v4l1_compat_get_picture(arg, file, drv); break; case VIDIOCSPICT: /* set tone controls & partial capture format */ - err = v4l1_compat_set_picture(arg, inode, file, drv); + err = v4l1_compat_set_picture(arg, file, drv); break; case VIDIOCGTUNER: /* get tuner information */ - err = v4l1_compat_get_tuner(arg, inode, file, drv); + err = v4l1_compat_get_tuner(arg, file, drv); break; case VIDIOCSTUNER: /* select a tuner input */ - err = v4l1_compat_select_tuner(arg, inode, file, drv); + err = v4l1_compat_select_tuner(arg, file, drv); break; case VIDIOCGFREQ: /* get frequency */ - err = v4l1_compat_get_frequency(arg, inode, file, drv); + err = v4l1_compat_get_frequency(arg, file, drv); break; case VIDIOCSFREQ: /* set frequency */ - err = v4l1_compat_set_frequency(arg, inode, file, drv); + err = v4l1_compat_set_frequency(arg, file, drv); break; case VIDIOCGAUDIO: /* get audio properties/controls */ - err = v4l1_compat_get_audio(arg, inode, file, drv); + err = v4l1_compat_get_audio(arg, file, drv); break; case VIDIOCSAUDIO: /* set audio controls */ - err = v4l1_compat_set_audio(arg, inode, file, drv); + err = v4l1_compat_set_audio(arg, file, drv); break; case VIDIOCMCAPTURE: /* capture a frame */ - err = v4l1_compat_capture_frame(arg, inode, file, drv); + err = v4l1_compat_capture_frame(arg, file, drv); break; case VIDIOCSYNC: /* wait for a frame */ - err = v4l1_compat_sync(arg, inode, file, drv); + err = v4l1_compat_sync(arg, file, drv); break; case VIDIOCGVBIFMT: /* query VBI data capture format */ - err = v4l1_compat_get_vbi_format(arg, inode, file, drv); + err = v4l1_compat_get_vbi_format(arg, file, drv); break; case VIDIOCSVBIFMT: - err = v4l1_compat_set_vbi_format(arg, inode, file, drv); + err = v4l1_compat_set_vbi_format(arg, file, drv); break; default: err = -ENOIOCTLCMD; diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 0417844d4079..5b3e251b9396 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c @@ -625,7 +625,7 @@ static int check_fmt(const struct v4l2_ioctl_ops *ops, enum v4l2_buf_type type) return -EINVAL; } -static int __video_do_ioctl(struct inode *inode, struct file *file, +static int __video_do_ioctl(struct file *file, unsigned int cmd, void *arg) { struct video_device *vfd = video_devdata(file); @@ -675,7 +675,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, V4L2 ioctls. ********************************************************/ if (_IOC_TYPE(cmd) == 'v' && _IOC_NR(cmd) < BASE_VIDIOCPRIVATE) - return v4l_compat_translate_ioctl(inode, file, cmd, arg, + return v4l_compat_translate_ioctl(file, cmd, arg, __video_do_ioctl); #endif @@ -1832,7 +1832,7 @@ int video_ioctl2(struct inode *inode, struct file *file, } /* Handles IOCTL */ - err = __video_do_ioctl(inode, file, cmd, parg); + err = __video_do_ioctl(file, cmd, parg); if (err == -ENOIOCTLCMD) err = -EINVAL; if (is_ext_ctrl) { diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 3e11dfe38dc3..7a919433a423 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h @@ -271,13 +271,13 @@ extern const char *v4l2_field_names[]; extern const char *v4l2_type_names[]; /* Compatibility layer interface -- v4l1-compat module */ -typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, +typedef int (*v4l2_kioctl)(struct file *file, unsigned int cmd, void *arg); #ifdef CONFIG_VIDEO_V4L1_COMPAT -int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, +int v4l_compat_translate_ioctl(struct file *file, int cmd, void *arg, v4l2_kioctl driver_ioctl); #else -#define v4l_compat_translate_ioctl(inode, file, cmd, arg, ioctl) (-EINVAL) +#define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL) #endif /* 32 Bits compatibility layer for 64 bits processors */