aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/saa7146_video.c12
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c11
-rw-r--r--drivers/media/video/uvc/uvc_v4l2.c12
-rw-r--r--drivers/media/video/v4l1-compat.c221
-rw-r--r--drivers/media/video/v4l2-ioctl.c6
5 files changed, 127 insertions, 135 deletions
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)
834 * copying is done already, arg is a kernel pointer. 834 * copying is done already, arg is a kernel pointer.
835 */ 835 */
836 836
837int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *arg) 837static int __saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
838{ 838{
839 struct saa7146_fh *fh = file->private_data; 839 struct saa7146_fh *fh = file->private_data;
840 struct saa7146_dev *dev = fh->dev; 840 struct saa7146_dev *dev = fh->dev;
@@ -1215,12 +1215,18 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
1215 } 1215 }
1216#endif 1216#endif
1217 default: 1217 default:
1218 return v4l_compat_translate_ioctl(inode,file,cmd,arg, 1218 return v4l_compat_translate_ioctl(file, cmd, arg,
1219 saa7146_video_do_ioctl); 1219 __saa7146_video_do_ioctl);
1220 } 1220 }
1221 return 0; 1221 return 0;
1222} 1222}
1223 1223
1224int saa7146_video_do_ioctl(struct inode *inode, struct file *file,
1225 unsigned int cmd, void *arg)
1226{
1227 return __saa7146_video_do_ioctl(file, cmd, arg);
1228}
1229
1224/*********************************************************************************/ 1230/*********************************************************************************/
1225/* buffer handling functions */ 1231/* buffer handling functions */
1226 1232
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)
168 * This is part of Video 4 Linux API. The procedure handles ioctl() calls. 168 * This is part of Video 4 Linux API. The procedure handles ioctl() calls.
169 * 169 *
170 */ 170 */
171static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, 171static int __pvr2_v4l2_do_ioctl(struct file *file,
172 unsigned int cmd, void *arg) 172 unsigned int cmd, void *arg)
173{ 173{
174 struct pvr2_v4l2_fh *fh = file->private_data; 174 struct pvr2_v4l2_fh *fh = file->private_data;
@@ -863,8 +863,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
863#endif 863#endif
864 864
865 default : 865 default :
866 ret = v4l_compat_translate_ioctl(inode,file,cmd, 866 ret = v4l_compat_translate_ioctl(file, cmd,
867 arg,pvr2_v4l2_do_ioctl); 867 arg, __pvr2_v4l2_do_ioctl);
868 } 868 }
869 869
870 pvr2_hdw_commit_ctl(hdw); 870 pvr2_hdw_commit_ctl(hdw);
@@ -890,6 +890,11 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
890 return ret; 890 return ret;
891} 891}
892 892
893static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
894 unsigned int cmd, void *arg)
895{
896 return __pvr2_v4l2_do_ioctl(file, cmd, arg);
897}
893 898
894static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip) 899static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
895{ 900{
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)
464 return 0; 464 return 0;
465} 465}
466 466
467static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file, 467static int __uvc_v4l2_do_ioctl(struct file *file,
468 unsigned int cmd, void *arg) 468 unsigned int cmd, void *arg)
469{ 469{
470 struct video_device *vdev = video_devdata(file); 470 struct video_device *vdev = video_devdata(file);
@@ -978,8 +978,8 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
978 return uvc_xu_ctrl_query(video, arg, 1); 978 return uvc_xu_ctrl_query(video, arg, 1);
979 979
980 default: 980 default:
981 if ((ret = v4l_compat_translate_ioctl(inode, file, cmd, arg, 981 if ((ret = v4l_compat_translate_ioctl(file, cmd, arg,
982 uvc_v4l2_do_ioctl)) == -ENOIOCTLCMD) 982 __uvc_v4l2_do_ioctl)) == -ENOIOCTLCMD)
983 uvc_trace(UVC_TRACE_IOCTL, "Unknown ioctl 0x%08x\n", 983 uvc_trace(UVC_TRACE_IOCTL, "Unknown ioctl 0x%08x\n",
984 cmd); 984 cmd);
985 return ret; 985 return ret;
@@ -988,6 +988,12 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
988 return ret; 988 return ret;
989} 989}
990 990
991static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
992 unsigned int cmd, void *arg)
993{
994 return __uvc_v4l2_do_ioctl(file, cmd, arg);
995}
996
991static int uvc_v4l2_ioctl(struct inode *inode, struct file *file, 997static int uvc_v4l2_ioctl(struct inode *inode, struct file *file,
992 unsigned int cmd, unsigned long arg) 998 unsigned int cmd, unsigned long arg)
993{ 999{
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");
57 */ 57 */
58 58
59static int 59static int
60get_v4l_control(struct inode *inode, 60get_v4l_control(struct file *file,
61 struct file *file,
62 int cid, 61 int cid,
63 v4l2_kioctl drv) 62 v4l2_kioctl drv)
64{ 63{
@@ -67,12 +66,12 @@ get_v4l_control(struct inode *inode,
67 int err; 66 int err;
68 67
69 qctrl2.id = cid; 68 qctrl2.id = cid;
70 err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2); 69 err = drv(file, VIDIOC_QUERYCTRL, &qctrl2);
71 if (err < 0) 70 if (err < 0)
72 dprintk("VIDIOC_QUERYCTRL: %d\n", err); 71 dprintk("VIDIOC_QUERYCTRL: %d\n", err);
73 if (err == 0 && !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) { 72 if (err == 0 && !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) {
74 ctrl2.id = qctrl2.id; 73 ctrl2.id = qctrl2.id;
75 err = drv(inode, file, VIDIOC_G_CTRL, &ctrl2); 74 err = drv(file, VIDIOC_G_CTRL, &ctrl2);
76 if (err < 0) { 75 if (err < 0) {
77 dprintk("VIDIOC_G_CTRL: %d\n", err); 76 dprintk("VIDIOC_G_CTRL: %d\n", err);
78 return 0; 77 return 0;
@@ -85,8 +84,7 @@ get_v4l_control(struct inode *inode,
85} 84}
86 85
87static int 86static int
88set_v4l_control(struct inode *inode, 87set_v4l_control(struct file *file,
89 struct file *file,
90 int cid, 88 int cid,
91 int value, 89 int value,
92 v4l2_kioctl drv) 90 v4l2_kioctl drv)
@@ -96,7 +94,7 @@ set_v4l_control(struct inode *inode,
96 int err; 94 int err;
97 95
98 qctrl2.id = cid; 96 qctrl2.id = cid;
99 err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2); 97 err = drv(file, VIDIOC_QUERYCTRL, &qctrl2);
100 if (err < 0) 98 if (err < 0)
101 dprintk("VIDIOC_QUERYCTRL: %d\n", err); 99 dprintk("VIDIOC_QUERYCTRL: %d\n", err);
102 if (err == 0 && 100 if (err == 0 &&
@@ -114,7 +112,7 @@ set_v4l_control(struct inode *inode,
114 + 32767) 112 + 32767)
115 / 65535; 113 / 65535;
116 ctrl2.value += qctrl2.minimum; 114 ctrl2.value += qctrl2.minimum;
117 err = drv(inode, file, VIDIOC_S_CTRL, &ctrl2); 115 err = drv(file, VIDIOC_S_CTRL, &ctrl2);
118 if (err < 0) 116 if (err < 0)
119 dprintk("VIDIOC_S_CTRL: %d\n", err); 117 dprintk("VIDIOC_S_CTRL: %d\n", err);
120 } 118 }
@@ -222,7 +220,6 @@ static int poll_one(struct file *file, struct poll_wqueues *pwq)
222} 220}
223 221
224static int count_inputs( 222static int count_inputs(
225 struct inode *inode,
226 struct file *file, 223 struct file *file,
227 v4l2_kioctl drv) 224 v4l2_kioctl drv)
228{ 225{
@@ -232,14 +229,13 @@ static int count_inputs(
232 for (i = 0;; i++) { 229 for (i = 0;; i++) {
233 memset(&input2, 0, sizeof(input2)); 230 memset(&input2, 0, sizeof(input2));
234 input2.index = i; 231 input2.index = i;
235 if (0 != drv(inode, file, VIDIOC_ENUMINPUT, &input2)) 232 if (0 != drv(file, VIDIOC_ENUMINPUT, &input2))
236 break; 233 break;
237 } 234 }
238 return i; 235 return i;
239} 236}
240 237
241static int check_size( 238static int check_size(
242 struct inode *inode,
243 struct file *file, 239 struct file *file,
244 v4l2_kioctl drv, 240 v4l2_kioctl drv,
245 int *maxw, 241 int *maxw,
@@ -252,14 +248,14 @@ static int check_size(
252 memset(&fmt2, 0, sizeof(fmt2)); 248 memset(&fmt2, 0, sizeof(fmt2));
253 249
254 desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 250 desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
255 if (0 != drv(inode, file, VIDIOC_ENUM_FMT, &desc2)) 251 if (0 != drv(file, VIDIOC_ENUM_FMT, &desc2))
256 goto done; 252 goto done;
257 253
258 fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 254 fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
259 fmt2.fmt.pix.width = 10000; 255 fmt2.fmt.pix.width = 10000;
260 fmt2.fmt.pix.height = 10000; 256 fmt2.fmt.pix.height = 10000;
261 fmt2.fmt.pix.pixelformat = desc2.pixelformat; 257 fmt2.fmt.pix.pixelformat = desc2.pixelformat;
262 if (0 != drv(inode, file, VIDIOC_TRY_FMT, &fmt2)) 258 if (0 != drv(file, VIDIOC_TRY_FMT, &fmt2))
263 goto done; 259 goto done;
264 260
265 *maxw = fmt2.fmt.pix.width; 261 *maxw = fmt2.fmt.pix.width;
@@ -273,7 +269,6 @@ done:
273 269
274static noinline int v4l1_compat_get_capabilities( 270static noinline int v4l1_compat_get_capabilities(
275 struct video_capability *cap, 271 struct video_capability *cap,
276 struct inode *inode,
277 struct file *file, 272 struct file *file,
278 v4l2_kioctl drv) 273 v4l2_kioctl drv)
279{ 274{
@@ -289,13 +284,13 @@ static noinline int v4l1_compat_get_capabilities(
289 memset(cap, 0, sizeof(*cap)); 284 memset(cap, 0, sizeof(*cap));
290 memset(&fbuf, 0, sizeof(fbuf)); 285 memset(&fbuf, 0, sizeof(fbuf));
291 286
292 err = drv(inode, file, VIDIOC_QUERYCAP, cap2); 287 err = drv(file, VIDIOC_QUERYCAP, cap2);
293 if (err < 0) { 288 if (err < 0) {
294 dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err); 289 dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err);
295 goto done; 290 goto done;
296 } 291 }
297 if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) { 292 if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) {
298 err = drv(inode, file, VIDIOC_G_FBUF, &fbuf); 293 err = drv(file, VIDIOC_G_FBUF, &fbuf);
299 if (err < 0) { 294 if (err < 0) {
300 dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err); 295 dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err);
301 memset(&fbuf, 0, sizeof(fbuf)); 296 memset(&fbuf, 0, sizeof(fbuf));
@@ -317,8 +312,8 @@ static noinline int v4l1_compat_get_capabilities(
317 if (fbuf.capability & V4L2_FBUF_CAP_LIST_CLIPPING) 312 if (fbuf.capability & V4L2_FBUF_CAP_LIST_CLIPPING)
318 cap->type |= VID_TYPE_CLIPPING; 313 cap->type |= VID_TYPE_CLIPPING;
319 314
320 cap->channels = count_inputs(inode, file, drv); 315 cap->channels = count_inputs(file, drv);
321 check_size(inode, file, drv, 316 check_size(file, drv,
322 &cap->maxwidth, &cap->maxheight); 317 &cap->maxwidth, &cap->maxheight);
323 cap->audios = 0; /* FIXME */ 318 cap->audios = 0; /* FIXME */
324 cap->minwidth = 48; /* FIXME */ 319 cap->minwidth = 48; /* FIXME */
@@ -331,7 +326,6 @@ done:
331 326
332static noinline int v4l1_compat_get_frame_buffer( 327static noinline int v4l1_compat_get_frame_buffer(
333 struct video_buffer *buffer, 328 struct video_buffer *buffer,
334 struct inode *inode,
335 struct file *file, 329 struct file *file,
336 v4l2_kioctl drv) 330 v4l2_kioctl drv)
337{ 331{
@@ -341,7 +335,7 @@ static noinline int v4l1_compat_get_frame_buffer(
341 memset(buffer, 0, sizeof(*buffer)); 335 memset(buffer, 0, sizeof(*buffer));
342 memset(&fbuf, 0, sizeof(fbuf)); 336 memset(&fbuf, 0, sizeof(fbuf));
343 337
344 err = drv(inode, file, VIDIOC_G_FBUF, &fbuf); 338 err = drv(file, VIDIOC_G_FBUF, &fbuf);
345 if (err < 0) { 339 if (err < 0) {
346 dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err); 340 dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err);
347 goto done; 341 goto done;
@@ -386,7 +380,6 @@ done:
386 380
387static noinline int v4l1_compat_set_frame_buffer( 381static noinline int v4l1_compat_set_frame_buffer(
388 struct video_buffer *buffer, 382 struct video_buffer *buffer,
389 struct inode *inode,
390 struct file *file, 383 struct file *file,
391 v4l2_kioctl drv) 384 v4l2_kioctl drv)
392{ 385{
@@ -415,7 +408,7 @@ static noinline int v4l1_compat_set_frame_buffer(
415 break; 408 break;
416 } 409 }
417 fbuf.fmt.bytesperline = buffer->bytesperline; 410 fbuf.fmt.bytesperline = buffer->bytesperline;
418 err = drv(inode, file, VIDIOC_S_FBUF, &fbuf); 411 err = drv(file, VIDIOC_S_FBUF, &fbuf);
419 if (err < 0) 412 if (err < 0)
420 dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err); 413 dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err);
421 return err; 414 return err;
@@ -423,7 +416,6 @@ static noinline int v4l1_compat_set_frame_buffer(
423 416
424static noinline int v4l1_compat_get_win_cap_dimensions( 417static noinline int v4l1_compat_get_win_cap_dimensions(
425 struct video_window *win, 418 struct video_window *win,
426 struct inode *inode,
427 struct file *file, 419 struct file *file,
428 v4l2_kioctl drv) 420 v4l2_kioctl drv)
429{ 421{
@@ -438,7 +430,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
438 memset(win, 0, sizeof(*win)); 430 memset(win, 0, sizeof(*win));
439 431
440 fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; 432 fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
441 err = drv(inode, file, VIDIOC_G_FMT, fmt); 433 err = drv(file, VIDIOC_G_FMT, fmt);
442 if (err < 0) 434 if (err < 0)
443 dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err); 435 dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err);
444 if (err == 0) { 436 if (err == 0) {
@@ -453,7 +445,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
453 } 445 }
454 446
455 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 447 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
456 err = drv(inode, file, VIDIOC_G_FMT, fmt); 448 err = drv(file, VIDIOC_G_FMT, fmt);
457 if (err < 0) { 449 if (err < 0) {
458 dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err); 450 dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err);
459 goto done; 451 goto done;
@@ -472,7 +464,6 @@ done:
472 464
473static noinline int v4l1_compat_set_win_cap_dimensions( 465static noinline int v4l1_compat_set_win_cap_dimensions(
474 struct video_window *win, 466 struct video_window *win,
475 struct inode *inode,
476 struct file *file, 467 struct file *file,
477 v4l2_kioctl drv) 468 v4l2_kioctl drv)
478{ 469{
@@ -485,8 +476,8 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
485 return err; 476 return err;
486 } 477 }
487 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 478 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
488 drv(inode, file, VIDIOC_STREAMOFF, &fmt->type); 479 drv(file, VIDIOC_STREAMOFF, &fmt->type);
489 err1 = drv(inode, file, VIDIOC_G_FMT, fmt); 480 err1 = drv(file, VIDIOC_G_FMT, fmt);
490 if (err1 < 0) 481 if (err1 < 0)
491 dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1); 482 dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1);
492 if (err1 == 0) { 483 if (err1 == 0) {
@@ -494,7 +485,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
494 fmt->fmt.pix.height = win->height; 485 fmt->fmt.pix.height = win->height;
495 fmt->fmt.pix.field = V4L2_FIELD_ANY; 486 fmt->fmt.pix.field = V4L2_FIELD_ANY;
496 fmt->fmt.pix.bytesperline = 0; 487 fmt->fmt.pix.bytesperline = 0;
497 err = drv(inode, file, VIDIOC_S_FMT, fmt); 488 err = drv(file, VIDIOC_S_FMT, fmt);
498 if (err < 0) 489 if (err < 0)
499 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n", 490 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n",
500 err); 491 err);
@@ -511,7 +502,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
511 fmt->fmt.win.chromakey = win->chromakey; 502 fmt->fmt.win.chromakey = win->chromakey;
512 fmt->fmt.win.clips = (void __user *)win->clips; 503 fmt->fmt.win.clips = (void __user *)win->clips;
513 fmt->fmt.win.clipcount = win->clipcount; 504 fmt->fmt.win.clipcount = win->clipcount;
514 err2 = drv(inode, file, VIDIOC_S_FMT, fmt); 505 err2 = drv(file, VIDIOC_S_FMT, fmt);
515 if (err2 < 0) 506 if (err2 < 0)
516 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2); 507 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2);
517 508
@@ -525,7 +516,6 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
525 516
526static noinline int v4l1_compat_turn_preview_on_off( 517static noinline int v4l1_compat_turn_preview_on_off(
527 int *on, 518 int *on,
528 struct inode *inode,
529 struct file *file, 519 struct file *file,
530 v4l2_kioctl drv) 520 v4l2_kioctl drv)
531{ 521{
@@ -536,9 +526,9 @@ static noinline int v4l1_compat_turn_preview_on_off(
536 /* dirty hack time. But v4l1 has no STREAMOFF 526 /* dirty hack time. But v4l1 has no STREAMOFF
537 * equivalent in the API, and this one at 527 * equivalent in the API, and this one at
538 * least comes close ... */ 528 * least comes close ... */
539 drv(inode, file, VIDIOC_STREAMOFF, &captype); 529 drv(file, VIDIOC_STREAMOFF, &captype);
540 } 530 }
541 err = drv(inode, file, VIDIOC_OVERLAY, on); 531 err = drv(file, VIDIOC_OVERLAY, on);
542 if (err < 0) 532 if (err < 0)
543 dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err); 533 dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err);
544 return err; 534 return err;
@@ -546,7 +536,6 @@ static noinline int v4l1_compat_turn_preview_on_off(
546 536
547static noinline int v4l1_compat_get_input_info( 537static noinline int v4l1_compat_get_input_info(
548 struct video_channel *chan, 538 struct video_channel *chan,
549 struct inode *inode,
550 struct file *file, 539 struct file *file,
551 v4l2_kioctl drv) 540 v4l2_kioctl drv)
552{ 541{
@@ -556,7 +545,7 @@ static noinline int v4l1_compat_get_input_info(
556 545
557 memset(&input2, 0, sizeof(input2)); 546 memset(&input2, 0, sizeof(input2));
558 input2.index = chan->channel; 547 input2.index = chan->channel;
559 err = drv(inode, file, VIDIOC_ENUMINPUT, &input2); 548 err = drv(file, VIDIOC_ENUMINPUT, &input2);
560 if (err < 0) { 549 if (err < 0) {
561 dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: " 550 dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: "
562 "channel=%d err=%d\n", chan->channel, err); 551 "channel=%d err=%d\n", chan->channel, err);
@@ -578,7 +567,7 @@ static noinline int v4l1_compat_get_input_info(
578 break; 567 break;
579 } 568 }
580 chan->norm = 0; 569 chan->norm = 0;
581 err = drv(inode, file, VIDIOC_G_STD, &sid); 570 err = drv(file, VIDIOC_G_STD, &sid);
582 if (err < 0) 571 if (err < 0)
583 dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err); 572 dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err);
584 if (err == 0) { 573 if (err == 0) {
@@ -595,14 +584,13 @@ done:
595 584
596static noinline int v4l1_compat_set_input( 585static noinline int v4l1_compat_set_input(
597 struct video_channel *chan, 586 struct video_channel *chan,
598 struct inode *inode,
599 struct file *file, 587 struct file *file,
600 v4l2_kioctl drv) 588 v4l2_kioctl drv)
601{ 589{
602 int err; 590 int err;
603 v4l2_std_id sid = 0; 591 v4l2_std_id sid = 0;
604 592
605 err = drv(inode, file, VIDIOC_S_INPUT, &chan->channel); 593 err = drv(file, VIDIOC_S_INPUT, &chan->channel);
606 if (err < 0) 594 if (err < 0)
607 dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err); 595 dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err);
608 switch (chan->norm) { 596 switch (chan->norm) {
@@ -617,7 +605,7 @@ static noinline int v4l1_compat_set_input(
617 break; 605 break;
618 } 606 }
619 if (0 != sid) { 607 if (0 != sid) {
620 err = drv(inode, file, VIDIOC_S_STD, &sid); 608 err = drv(file, VIDIOC_S_STD, &sid);
621 if (err < 0) 609 if (err < 0)
622 dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err); 610 dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err);
623 } 611 }
@@ -626,7 +614,6 @@ static noinline int v4l1_compat_set_input(
626 614
627static noinline int v4l1_compat_get_picture( 615static noinline int v4l1_compat_get_picture(
628 struct video_picture *pict, 616 struct video_picture *pict,
629 struct inode *inode,
630 struct file *file, 617 struct file *file,
631 v4l2_kioctl drv) 618 v4l2_kioctl drv)
632{ 619{
@@ -639,19 +626,19 @@ static noinline int v4l1_compat_get_picture(
639 return err; 626 return err;
640 } 627 }
641 628
642 pict->brightness = get_v4l_control(inode, file, 629 pict->brightness = get_v4l_control(file,
643 V4L2_CID_BRIGHTNESS, drv); 630 V4L2_CID_BRIGHTNESS, drv);
644 pict->hue = get_v4l_control(inode, file, 631 pict->hue = get_v4l_control(file,
645 V4L2_CID_HUE, drv); 632 V4L2_CID_HUE, drv);
646 pict->contrast = get_v4l_control(inode, file, 633 pict->contrast = get_v4l_control(file,
647 V4L2_CID_CONTRAST, drv); 634 V4L2_CID_CONTRAST, drv);
648 pict->colour = get_v4l_control(inode, file, 635 pict->colour = get_v4l_control(file,
649 V4L2_CID_SATURATION, drv); 636 V4L2_CID_SATURATION, drv);
650 pict->whiteness = get_v4l_control(inode, file, 637 pict->whiteness = get_v4l_control(file,
651 V4L2_CID_WHITENESS, drv); 638 V4L2_CID_WHITENESS, drv);
652 639
653 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 640 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
654 err = drv(inode, file, VIDIOC_G_FMT, fmt); 641 err = drv(file, VIDIOC_G_FMT, fmt);
655 if (err < 0) { 642 if (err < 0) {
656 dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err); 643 dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err);
657 goto done; 644 goto done;
@@ -669,7 +656,6 @@ done:
669 656
670static noinline int v4l1_compat_set_picture( 657static noinline int v4l1_compat_set_picture(
671 struct video_picture *pict, 658 struct video_picture *pict,
672 struct inode *inode,
673 struct file *file, 659 struct file *file,
674 v4l2_kioctl drv) 660 v4l2_kioctl drv)
675{ 661{
@@ -685,15 +671,15 @@ static noinline int v4l1_compat_set_picture(
685 } 671 }
686 memset(&fbuf, 0, sizeof(fbuf)); 672 memset(&fbuf, 0, sizeof(fbuf));
687 673
688 set_v4l_control(inode, file, 674 set_v4l_control(file,
689 V4L2_CID_BRIGHTNESS, pict->brightness, drv); 675 V4L2_CID_BRIGHTNESS, pict->brightness, drv);
690 set_v4l_control(inode, file, 676 set_v4l_control(file,
691 V4L2_CID_HUE, pict->hue, drv); 677 V4L2_CID_HUE, pict->hue, drv);
692 set_v4l_control(inode, file, 678 set_v4l_control(file,
693 V4L2_CID_CONTRAST, pict->contrast, drv); 679 V4L2_CID_CONTRAST, pict->contrast, drv);
694 set_v4l_control(inode, file, 680 set_v4l_control(file,
695 V4L2_CID_SATURATION, pict->colour, drv); 681 V4L2_CID_SATURATION, pict->colour, drv);
696 set_v4l_control(inode, file, 682 set_v4l_control(file,
697 V4L2_CID_WHITENESS, pict->whiteness, drv); 683 V4L2_CID_WHITENESS, pict->whiteness, drv);
698 /* 684 /*
699 * V4L1 uses this ioctl to set both memory capture and overlay 685 * V4L1 uses this ioctl to set both memory capture and overlay
@@ -703,7 +689,7 @@ static noinline int v4l1_compat_set_picture(
703 */ 689 */
704 690
705 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 691 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
706 err = drv(inode, file, VIDIOC_G_FMT, fmt); 692 err = drv(file, VIDIOC_G_FMT, fmt);
707 /* If VIDIOC_G_FMT failed, then the driver likely doesn't 693 /* If VIDIOC_G_FMT failed, then the driver likely doesn't
708 support memory capture. Trying to set the memory capture 694 support memory capture. Trying to set the memory capture
709 parameters would be pointless. */ 695 parameters would be pointless. */
@@ -714,13 +700,13 @@ static noinline int v4l1_compat_set_picture(
714 palette_to_pixelformat(pict->palette)) { 700 palette_to_pixelformat(pict->palette)) {
715 fmt->fmt.pix.pixelformat = palette_to_pixelformat( 701 fmt->fmt.pix.pixelformat = palette_to_pixelformat(
716 pict->palette); 702 pict->palette);
717 mem_err = drv(inode, file, VIDIOC_S_FMT, fmt); 703 mem_err = drv(file, VIDIOC_S_FMT, fmt);
718 if (mem_err < 0) 704 if (mem_err < 0)
719 dprintk("VIDIOCSPICT / VIDIOC_S_FMT: %d\n", 705 dprintk("VIDIOCSPICT / VIDIOC_S_FMT: %d\n",
720 mem_err); 706 mem_err);
721 } 707 }
722 708
723 err = drv(inode, file, VIDIOC_G_FBUF, &fbuf); 709 err = drv(file, VIDIOC_G_FBUF, &fbuf);
724 /* If VIDIOC_G_FBUF failed, then the driver likely doesn't 710 /* If VIDIOC_G_FBUF failed, then the driver likely doesn't
725 support overlay. Trying to set the overlay parameters 711 support overlay. Trying to set the overlay parameters
726 would be quite pointless. */ 712 would be quite pointless. */
@@ -731,7 +717,7 @@ static noinline int v4l1_compat_set_picture(
731 palette_to_pixelformat(pict->palette)) { 717 palette_to_pixelformat(pict->palette)) {
732 fbuf.fmt.pixelformat = palette_to_pixelformat( 718 fbuf.fmt.pixelformat = palette_to_pixelformat(
733 pict->palette); 719 pict->palette);
734 ovl_err = drv(inode, file, VIDIOC_S_FBUF, &fbuf); 720 ovl_err = drv(file, VIDIOC_S_FBUF, &fbuf);
735 if (ovl_err < 0) 721 if (ovl_err < 0)
736 dprintk("VIDIOCSPICT / VIDIOC_S_FBUF: %d\n", 722 dprintk("VIDIOCSPICT / VIDIOC_S_FBUF: %d\n",
737 ovl_err); 723 ovl_err);
@@ -752,7 +738,6 @@ static noinline int v4l1_compat_set_picture(
752 738
753static noinline int v4l1_compat_get_tuner( 739static noinline int v4l1_compat_get_tuner(
754 struct video_tuner *tun, 740 struct video_tuner *tun,
755 struct inode *inode,
756 struct file *file, 741 struct file *file,
757 v4l2_kioctl drv) 742 v4l2_kioctl drv)
758{ 743{
@@ -762,7 +747,7 @@ static noinline int v4l1_compat_get_tuner(
762 v4l2_std_id sid; 747 v4l2_std_id sid;
763 748
764 memset(&tun2, 0, sizeof(tun2)); 749 memset(&tun2, 0, sizeof(tun2));
765 err = drv(inode, file, VIDIOC_G_TUNER, &tun2); 750 err = drv(file, VIDIOC_G_TUNER, &tun2);
766 if (err < 0) { 751 if (err < 0) {
767 dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err); 752 dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err);
768 goto done; 753 goto done;
@@ -778,7 +763,7 @@ static noinline int v4l1_compat_get_tuner(
778 for (i = 0; i < 64; i++) { 763 for (i = 0; i < 64; i++) {
779 memset(&std2, 0, sizeof(std2)); 764 memset(&std2, 0, sizeof(std2));
780 std2.index = i; 765 std2.index = i;
781 if (0 != drv(inode, file, VIDIOC_ENUMSTD, &std2)) 766 if (0 != drv(file, VIDIOC_ENUMSTD, &std2))
782 break; 767 break;
783 if (std2.id & V4L2_STD_PAL) 768 if (std2.id & V4L2_STD_PAL)
784 tun->flags |= VIDEO_TUNER_PAL; 769 tun->flags |= VIDEO_TUNER_PAL;
@@ -788,7 +773,7 @@ static noinline int v4l1_compat_get_tuner(
788 tun->flags |= VIDEO_TUNER_SECAM; 773 tun->flags |= VIDEO_TUNER_SECAM;
789 } 774 }
790 775
791 err = drv(inode, file, VIDIOC_G_STD, &sid); 776 err = drv(file, VIDIOC_G_STD, &sid);
792 if (err < 0) 777 if (err < 0)
793 dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err); 778 dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err);
794 if (err == 0) { 779 if (err == 0) {
@@ -811,7 +796,6 @@ done:
811 796
812static noinline int v4l1_compat_select_tuner( 797static noinline int v4l1_compat_select_tuner(
813 struct video_tuner *tun, 798 struct video_tuner *tun,
814 struct inode *inode,
815 struct file *file, 799 struct file *file,
816 v4l2_kioctl drv) 800 v4l2_kioctl drv)
817{ 801{
@@ -821,7 +805,7 @@ static noinline int v4l1_compat_select_tuner(
821 805
822 t.index = tun->tuner; 806 t.index = tun->tuner;
823 807
824 err = drv(inode, file, VIDIOC_S_INPUT, &t); 808 err = drv(file, VIDIOC_S_INPUT, &t);
825 if (err < 0) 809 if (err < 0)
826 dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err); 810 dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err);
827 return err; 811 return err;
@@ -829,7 +813,6 @@ static noinline int v4l1_compat_select_tuner(
829 813
830static noinline int v4l1_compat_get_frequency( 814static noinline int v4l1_compat_get_frequency(
831 unsigned long *freq, 815 unsigned long *freq,
832 struct inode *inode,
833 struct file *file, 816 struct file *file,
834 v4l2_kioctl drv) 817 v4l2_kioctl drv)
835{ 818{
@@ -838,7 +821,7 @@ static noinline int v4l1_compat_get_frequency(
838 memset(&freq2, 0, sizeof(freq2)); 821 memset(&freq2, 0, sizeof(freq2));
839 822
840 freq2.tuner = 0; 823 freq2.tuner = 0;
841 err = drv(inode, file, VIDIOC_G_FREQUENCY, &freq2); 824 err = drv(file, VIDIOC_G_FREQUENCY, &freq2);
842 if (err < 0) 825 if (err < 0)
843 dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err); 826 dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err);
844 if (0 == err) 827 if (0 == err)
@@ -848,7 +831,6 @@ static noinline int v4l1_compat_get_frequency(
848 831
849static noinline int v4l1_compat_set_frequency( 832static noinline int v4l1_compat_set_frequency(
850 unsigned long *freq, 833 unsigned long *freq,
851 struct inode *inode,
852 struct file *file, 834 struct file *file,
853 v4l2_kioctl drv) 835 v4l2_kioctl drv)
854{ 836{
@@ -856,9 +838,9 @@ static noinline int v4l1_compat_set_frequency(
856 struct v4l2_frequency freq2; 838 struct v4l2_frequency freq2;
857 memset(&freq2, 0, sizeof(freq2)); 839 memset(&freq2, 0, sizeof(freq2));
858 840
859 drv(inode, file, VIDIOC_G_FREQUENCY, &freq2); 841 drv(file, VIDIOC_G_FREQUENCY, &freq2);
860 freq2.frequency = *freq; 842 freq2.frequency = *freq;
861 err = drv(inode, file, VIDIOC_S_FREQUENCY, &freq2); 843 err = drv(file, VIDIOC_S_FREQUENCY, &freq2);
862 if (err < 0) 844 if (err < 0)
863 dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err); 845 dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err);
864 return err; 846 return err;
@@ -866,7 +848,6 @@ static noinline int v4l1_compat_set_frequency(
866 848
867static noinline int v4l1_compat_get_audio( 849static noinline int v4l1_compat_get_audio(
868 struct video_audio *aud, 850 struct video_audio *aud,
869 struct inode *inode,
870 struct file *file, 851 struct file *file,
871 v4l2_kioctl drv) 852 v4l2_kioctl drv)
872{ 853{
@@ -876,7 +857,7 @@ static noinline int v4l1_compat_get_audio(
876 struct v4l2_tuner tun2; 857 struct v4l2_tuner tun2;
877 memset(&aud2, 0, sizeof(aud2)); 858 memset(&aud2, 0, sizeof(aud2));
878 859
879 err = drv(inode, file, VIDIOC_G_AUDIO, &aud2); 860 err = drv(file, VIDIOC_G_AUDIO, &aud2);
880 if (err < 0) { 861 if (err < 0) {
881 dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err); 862 dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err);
882 goto done; 863 goto done;
@@ -886,27 +867,27 @@ static noinline int v4l1_compat_get_audio(
886 aud->name[sizeof(aud->name) - 1] = 0; 867 aud->name[sizeof(aud->name) - 1] = 0;
887 aud->audio = aud2.index; 868 aud->audio = aud2.index;
888 aud->flags = 0; 869 aud->flags = 0;
889 i = get_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME, drv); 870 i = get_v4l_control(file, V4L2_CID_AUDIO_VOLUME, drv);
890 if (i >= 0) { 871 if (i >= 0) {
891 aud->volume = i; 872 aud->volume = i;
892 aud->flags |= VIDEO_AUDIO_VOLUME; 873 aud->flags |= VIDEO_AUDIO_VOLUME;
893 } 874 }
894 i = get_v4l_control(inode, file, V4L2_CID_AUDIO_BASS, drv); 875 i = get_v4l_control(file, V4L2_CID_AUDIO_BASS, drv);
895 if (i >= 0) { 876 if (i >= 0) {
896 aud->bass = i; 877 aud->bass = i;
897 aud->flags |= VIDEO_AUDIO_BASS; 878 aud->flags |= VIDEO_AUDIO_BASS;
898 } 879 }
899 i = get_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE, drv); 880 i = get_v4l_control(file, V4L2_CID_AUDIO_TREBLE, drv);
900 if (i >= 0) { 881 if (i >= 0) {
901 aud->treble = i; 882 aud->treble = i;
902 aud->flags |= VIDEO_AUDIO_TREBLE; 883 aud->flags |= VIDEO_AUDIO_TREBLE;
903 } 884 }
904 i = get_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE, drv); 885 i = get_v4l_control(file, V4L2_CID_AUDIO_BALANCE, drv);
905 if (i >= 0) { 886 if (i >= 0) {
906 aud->balance = i; 887 aud->balance = i;
907 aud->flags |= VIDEO_AUDIO_BALANCE; 888 aud->flags |= VIDEO_AUDIO_BALANCE;
908 } 889 }
909 i = get_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE, drv); 890 i = get_v4l_control(file, V4L2_CID_AUDIO_MUTE, drv);
910 if (i >= 0) { 891 if (i >= 0) {
911 if (i) 892 if (i)
912 aud->flags |= VIDEO_AUDIO_MUTE; 893 aud->flags |= VIDEO_AUDIO_MUTE;
@@ -914,13 +895,13 @@ static noinline int v4l1_compat_get_audio(
914 } 895 }
915 aud->step = 1; 896 aud->step = 1;
916 qctrl2.id = V4L2_CID_AUDIO_VOLUME; 897 qctrl2.id = V4L2_CID_AUDIO_VOLUME;
917 if (drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2) == 0 && 898 if (drv(file, VIDIOC_QUERYCTRL, &qctrl2) == 0 &&
918 !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) 899 !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED))
919 aud->step = qctrl2.step; 900 aud->step = qctrl2.step;
920 aud->mode = 0; 901 aud->mode = 0;
921 902
922 memset(&tun2, 0, sizeof(tun2)); 903 memset(&tun2, 0, sizeof(tun2));
923 err = drv(inode, file, VIDIOC_G_TUNER, &tun2); 904 err = drv(file, VIDIOC_G_TUNER, &tun2);
924 if (err < 0) { 905 if (err < 0) {
925 dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err); 906 dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err);
926 err = 0; 907 err = 0;
@@ -939,7 +920,6 @@ done:
939 920
940static noinline int v4l1_compat_set_audio( 921static noinline int v4l1_compat_set_audio(
941 struct video_audio *aud, 922 struct video_audio *aud,
942 struct inode *inode,
943 struct file *file, 923 struct file *file,
944 v4l2_kioctl drv) 924 v4l2_kioctl drv)
945{ 925{
@@ -951,24 +931,24 @@ static noinline int v4l1_compat_set_audio(
951 memset(&tun2, 0, sizeof(tun2)); 931 memset(&tun2, 0, sizeof(tun2));
952 932
953 aud2.index = aud->audio; 933 aud2.index = aud->audio;
954 err = drv(inode, file, VIDIOC_S_AUDIO, &aud2); 934 err = drv(file, VIDIOC_S_AUDIO, &aud2);
955 if (err < 0) { 935 if (err < 0) {
956 dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err); 936 dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err);
957 goto done; 937 goto done;
958 } 938 }
959 939
960 set_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME, 940 set_v4l_control(file, V4L2_CID_AUDIO_VOLUME,
961 aud->volume, drv); 941 aud->volume, drv);
962 set_v4l_control(inode, file, V4L2_CID_AUDIO_BASS, 942 set_v4l_control(file, V4L2_CID_AUDIO_BASS,
963 aud->bass, drv); 943 aud->bass, drv);
964 set_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE, 944 set_v4l_control(file, V4L2_CID_AUDIO_TREBLE,
965 aud->treble, drv); 945 aud->treble, drv);
966 set_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE, 946 set_v4l_control(file, V4L2_CID_AUDIO_BALANCE,
967 aud->balance, drv); 947 aud->balance, drv);
968 set_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE, 948 set_v4l_control(file, V4L2_CID_AUDIO_MUTE,
969 !!(aud->flags & VIDEO_AUDIO_MUTE), drv); 949 !!(aud->flags & VIDEO_AUDIO_MUTE), drv);
970 950
971 err = drv(inode, file, VIDIOC_G_TUNER, &tun2); 951 err = drv(file, VIDIOC_G_TUNER, &tun2);
972 if (err < 0) 952 if (err < 0)
973 dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err); 953 dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err);
974 if (err == 0) { 954 if (err == 0) {
@@ -985,7 +965,7 @@ static noinline int v4l1_compat_set_audio(
985 tun2.audmode = V4L2_TUNER_MODE_LANG2; 965 tun2.audmode = V4L2_TUNER_MODE_LANG2;
986 break; 966 break;
987 } 967 }
988 err = drv(inode, file, VIDIOC_S_TUNER, &tun2); 968 err = drv(file, VIDIOC_S_TUNER, &tun2);
989 if (err < 0) 969 if (err < 0)
990 dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err); 970 dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err);
991 } 971 }
@@ -996,7 +976,6 @@ done:
996 976
997static noinline int v4l1_compat_capture_frame( 977static noinline int v4l1_compat_capture_frame(
998 struct video_mmap *mm, 978 struct video_mmap *mm,
999 struct inode *inode,
1000 struct file *file, 979 struct file *file,
1001 v4l2_kioctl drv) 980 v4l2_kioctl drv)
1002{ 981{
@@ -1013,7 +992,7 @@ static noinline int v4l1_compat_capture_frame(
1013 memset(&buf, 0, sizeof(buf)); 992 memset(&buf, 0, sizeof(buf));
1014 993
1015 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 994 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1016 err = drv(inode, file, VIDIOC_G_FMT, fmt); 995 err = drv(file, VIDIOC_G_FMT, fmt);
1017 if (err < 0) { 996 if (err < 0) {
1018 dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err); 997 dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err);
1019 goto done; 998 goto done;
@@ -1029,7 +1008,7 @@ static noinline int v4l1_compat_capture_frame(
1029 palette_to_pixelformat(mm->format); 1008 palette_to_pixelformat(mm->format);
1030 fmt->fmt.pix.field = V4L2_FIELD_ANY; 1009 fmt->fmt.pix.field = V4L2_FIELD_ANY;
1031 fmt->fmt.pix.bytesperline = 0; 1010 fmt->fmt.pix.bytesperline = 0;
1032 err = drv(inode, file, VIDIOC_S_FMT, fmt); 1011 err = drv(file, VIDIOC_S_FMT, fmt);
1033 if (err < 0) { 1012 if (err < 0) {
1034 dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err); 1013 dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err);
1035 goto done; 1014 goto done;
@@ -1037,17 +1016,17 @@ static noinline int v4l1_compat_capture_frame(
1037 } 1016 }
1038 buf.index = mm->frame; 1017 buf.index = mm->frame;
1039 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1018 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1040 err = drv(inode, file, VIDIOC_QUERYBUF, &buf); 1019 err = drv(file, VIDIOC_QUERYBUF, &buf);
1041 if (err < 0) { 1020 if (err < 0) {
1042 dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err); 1021 dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err);
1043 goto done; 1022 goto done;
1044 } 1023 }
1045 err = drv(inode, file, VIDIOC_QBUF, &buf); 1024 err = drv(file, VIDIOC_QBUF, &buf);
1046 if (err < 0) { 1025 if (err < 0) {
1047 dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err); 1026 dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err);
1048 goto done; 1027 goto done;
1049 } 1028 }
1050 err = drv(inode, file, VIDIOC_STREAMON, &captype); 1029 err = drv(file, VIDIOC_STREAMON, &captype);
1051 if (err < 0) 1030 if (err < 0)
1052 dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err); 1031 dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err);
1053done: 1032done:
@@ -1057,7 +1036,6 @@ done:
1057 1036
1058static noinline int v4l1_compat_sync( 1037static noinline int v4l1_compat_sync(
1059 int *i, 1038 int *i,
1060 struct inode *inode,
1061 struct file *file, 1039 struct file *file,
1062 v4l2_kioctl drv) 1040 v4l2_kioctl drv)
1063{ 1041{
@@ -1069,7 +1047,7 @@ static noinline int v4l1_compat_sync(
1069 memset(&buf, 0, sizeof(buf)); 1047 memset(&buf, 0, sizeof(buf));
1070 buf.index = *i; 1048 buf.index = *i;
1071 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1049 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1072 err = drv(inode, file, VIDIOC_QUERYBUF, &buf); 1050 err = drv(file, VIDIOC_QUERYBUF, &buf);
1073 if (err < 0) { 1051 if (err < 0) {
1074 /* No such buffer */ 1052 /* No such buffer */
1075 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); 1053 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
@@ -1082,7 +1060,7 @@ static noinline int v4l1_compat_sync(
1082 } 1060 }
1083 1061
1084 /* make sure capture actually runs so we don't block forever */ 1062 /* make sure capture actually runs so we don't block forever */
1085 err = drv(inode, file, VIDIOC_STREAMON, &captype); 1063 err = drv(file, VIDIOC_STREAMON, &captype);
1086 if (err < 0) { 1064 if (err < 0) {
1087 dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err); 1065 dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err);
1088 goto done; 1066 goto done;
@@ -1096,7 +1074,7 @@ static noinline int v4l1_compat_sync(
1096 if (err < 0 || /* error or sleep was interrupted */ 1074 if (err < 0 || /* error or sleep was interrupted */
1097 err == 0) /* timeout? Shouldn't occur. */ 1075 err == 0) /* timeout? Shouldn't occur. */
1098 break; 1076 break;
1099 err = drv(inode, file, VIDIOC_QUERYBUF, &buf); 1077 err = drv(file, VIDIOC_QUERYBUF, &buf);
1100 if (err < 0) 1078 if (err < 0)
1101 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); 1079 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
1102 } 1080 }
@@ -1104,7 +1082,7 @@ static noinline int v4l1_compat_sync(
1104 if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */ 1082 if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */
1105 goto done; 1083 goto done;
1106 do { 1084 do {
1107 err = drv(inode, file, VIDIOC_DQBUF, &buf); 1085 err = drv(file, VIDIOC_DQBUF, &buf);
1108 if (err < 0) 1086 if (err < 0)
1109 dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err); 1087 dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err);
1110 } while (err == 0 && buf.index != *i); 1088 } while (err == 0 && buf.index != *i);
@@ -1114,7 +1092,6 @@ done:
1114 1092
1115static noinline int v4l1_compat_get_vbi_format( 1093static noinline int v4l1_compat_get_vbi_format(
1116 struct vbi_format *fmt, 1094 struct vbi_format *fmt,
1117 struct inode *inode,
1118 struct file *file, 1095 struct file *file,
1119 v4l2_kioctl drv) 1096 v4l2_kioctl drv)
1120{ 1097{
@@ -1128,7 +1105,7 @@ static noinline int v4l1_compat_get_vbi_format(
1128 } 1105 }
1129 fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE; 1106 fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
1130 1107
1131 err = drv(inode, file, VIDIOC_G_FMT, fmt2); 1108 err = drv(file, VIDIOC_G_FMT, fmt2);
1132 if (err < 0) { 1109 if (err < 0) {
1133 dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err); 1110 dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err);
1134 goto done; 1111 goto done;
@@ -1153,7 +1130,6 @@ done:
1153 1130
1154static noinline int v4l1_compat_set_vbi_format( 1131static noinline int v4l1_compat_set_vbi_format(
1155 struct vbi_format *fmt, 1132 struct vbi_format *fmt,
1156 struct inode *inode,
1157 struct file *file, 1133 struct file *file,
1158 v4l2_kioctl drv) 1134 v4l2_kioctl drv)
1159{ 1135{
@@ -1179,7 +1155,7 @@ static noinline int v4l1_compat_set_vbi_format(
1179 fmt2->fmt.vbi.start[1] = fmt->start[1]; 1155 fmt2->fmt.vbi.start[1] = fmt->start[1];
1180 fmt2->fmt.vbi.count[1] = fmt->count[1]; 1156 fmt2->fmt.vbi.count[1] = fmt->count[1];
1181 fmt2->fmt.vbi.flags = fmt->flags; 1157 fmt2->fmt.vbi.flags = fmt->flags;
1182 err = drv(inode, file, VIDIOC_TRY_FMT, fmt2); 1158 err = drv(file, VIDIOC_TRY_FMT, fmt2);
1183 if (err < 0) { 1159 if (err < 0) {
1184 dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err); 1160 dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err);
1185 goto done; 1161 goto done;
@@ -1196,7 +1172,7 @@ static noinline int v4l1_compat_set_vbi_format(
1196 err = -EINVAL; 1172 err = -EINVAL;
1197 goto done; 1173 goto done;
1198 } 1174 }
1199 err = drv(inode, file, VIDIOC_S_FMT, fmt2); 1175 err = drv(file, VIDIOC_S_FMT, fmt2);
1200 if (err < 0) 1176 if (err < 0)
1201 dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err); 1177 dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err);
1202done: 1178done:
@@ -1208,8 +1184,7 @@ done:
1208 * This function is exported. 1184 * This function is exported.
1209 */ 1185 */
1210int 1186int
1211v4l_compat_translate_ioctl(struct inode *inode, 1187v4l_compat_translate_ioctl(struct file *file,
1212 struct file *file,
1213 int cmd, 1188 int cmd,
1214 void *arg, 1189 void *arg,
1215 v4l2_kioctl drv) 1190 v4l2_kioctl drv)
@@ -1218,64 +1193,64 @@ v4l_compat_translate_ioctl(struct inode *inode,
1218 1193
1219 switch (cmd) { 1194 switch (cmd) {
1220 case VIDIOCGCAP: /* capability */ 1195 case VIDIOCGCAP: /* capability */
1221 err = v4l1_compat_get_capabilities(arg, inode, file, drv); 1196 err = v4l1_compat_get_capabilities(arg, file, drv);
1222 break; 1197 break;
1223 case VIDIOCGFBUF: /* get frame buffer */ 1198 case VIDIOCGFBUF: /* get frame buffer */
1224 err = v4l1_compat_get_frame_buffer(arg, inode, file, drv); 1199 err = v4l1_compat_get_frame_buffer(arg, file, drv);
1225 break; 1200 break;
1226 case VIDIOCSFBUF: /* set frame buffer */ 1201 case VIDIOCSFBUF: /* set frame buffer */
1227 err = v4l1_compat_set_frame_buffer(arg, inode, file, drv); 1202 err = v4l1_compat_set_frame_buffer(arg, file, drv);
1228 break; 1203 break;
1229 case VIDIOCGWIN: /* get window or capture dimensions */ 1204 case VIDIOCGWIN: /* get window or capture dimensions */
1230 err = v4l1_compat_get_win_cap_dimensions(arg, inode, file, drv); 1205 err = v4l1_compat_get_win_cap_dimensions(arg, file, drv);
1231 break; 1206 break;
1232 case VIDIOCSWIN: /* set window and/or capture dimensions */ 1207 case VIDIOCSWIN: /* set window and/or capture dimensions */
1233 err = v4l1_compat_set_win_cap_dimensions(arg, inode, file, drv); 1208 err = v4l1_compat_set_win_cap_dimensions(arg, file, drv);
1234 break; 1209 break;
1235 case VIDIOCCAPTURE: /* turn on/off preview */ 1210 case VIDIOCCAPTURE: /* turn on/off preview */
1236 err = v4l1_compat_turn_preview_on_off(arg, inode, file, drv); 1211 err = v4l1_compat_turn_preview_on_off(arg, file, drv);
1237 break; 1212 break;
1238 case VIDIOCGCHAN: /* get input information */ 1213 case VIDIOCGCHAN: /* get input information */
1239 err = v4l1_compat_get_input_info(arg, inode, file, drv); 1214 err = v4l1_compat_get_input_info(arg, file, drv);
1240 break; 1215 break;
1241 case VIDIOCSCHAN: /* set input */ 1216 case VIDIOCSCHAN: /* set input */
1242 err = v4l1_compat_set_input(arg, inode, file, drv); 1217 err = v4l1_compat_set_input(arg, file, drv);
1243 break; 1218 break;
1244 case VIDIOCGPICT: /* get tone controls & partial capture format */ 1219 case VIDIOCGPICT: /* get tone controls & partial capture format */
1245 err = v4l1_compat_get_picture(arg, inode, file, drv); 1220 err = v4l1_compat_get_picture(arg, file, drv);
1246 break; 1221 break;
1247 case VIDIOCSPICT: /* set tone controls & partial capture format */ 1222 case VIDIOCSPICT: /* set tone controls & partial capture format */
1248 err = v4l1_compat_set_picture(arg, inode, file, drv); 1223 err = v4l1_compat_set_picture(arg, file, drv);
1249 break; 1224 break;
1250 case VIDIOCGTUNER: /* get tuner information */ 1225 case VIDIOCGTUNER: /* get tuner information */
1251 err = v4l1_compat_get_tuner(arg, inode, file, drv); 1226 err = v4l1_compat_get_tuner(arg, file, drv);
1252 break; 1227 break;
1253 case VIDIOCSTUNER: /* select a tuner input */ 1228 case VIDIOCSTUNER: /* select a tuner input */
1254 err = v4l1_compat_select_tuner(arg, inode, file, drv); 1229 err = v4l1_compat_select_tuner(arg, file, drv);
1255 break; 1230 break;
1256 case VIDIOCGFREQ: /* get frequency */ 1231 case VIDIOCGFREQ: /* get frequency */
1257 err = v4l1_compat_get_frequency(arg, inode, file, drv); 1232 err = v4l1_compat_get_frequency(arg, file, drv);
1258 break; 1233 break;
1259 case VIDIOCSFREQ: /* set frequency */ 1234 case VIDIOCSFREQ: /* set frequency */
1260 err = v4l1_compat_set_frequency(arg, inode, file, drv); 1235 err = v4l1_compat_set_frequency(arg, file, drv);
1261 break; 1236 break;
1262 case VIDIOCGAUDIO: /* get audio properties/controls */ 1237 case VIDIOCGAUDIO: /* get audio properties/controls */
1263 err = v4l1_compat_get_audio(arg, inode, file, drv); 1238 err = v4l1_compat_get_audio(arg, file, drv);
1264 break; 1239 break;
1265 case VIDIOCSAUDIO: /* set audio controls */ 1240 case VIDIOCSAUDIO: /* set audio controls */
1266 err = v4l1_compat_set_audio(arg, inode, file, drv); 1241 err = v4l1_compat_set_audio(arg, file, drv);
1267 break; 1242 break;
1268 case VIDIOCMCAPTURE: /* capture a frame */ 1243 case VIDIOCMCAPTURE: /* capture a frame */
1269 err = v4l1_compat_capture_frame(arg, inode, file, drv); 1244 err = v4l1_compat_capture_frame(arg, file, drv);
1270 break; 1245 break;
1271 case VIDIOCSYNC: /* wait for a frame */ 1246 case VIDIOCSYNC: /* wait for a frame */
1272 err = v4l1_compat_sync(arg, inode, file, drv); 1247 err = v4l1_compat_sync(arg, file, drv);
1273 break; 1248 break;
1274 case VIDIOCGVBIFMT: /* query VBI data capture format */ 1249 case VIDIOCGVBIFMT: /* query VBI data capture format */
1275 err = v4l1_compat_get_vbi_format(arg, inode, file, drv); 1250 err = v4l1_compat_get_vbi_format(arg, file, drv);
1276 break; 1251 break;
1277 case VIDIOCSVBIFMT: 1252 case VIDIOCSVBIFMT:
1278 err = v4l1_compat_set_vbi_format(arg, inode, file, drv); 1253 err = v4l1_compat_set_vbi_format(arg, file, drv);
1279 break; 1254 break;
1280 default: 1255 default:
1281 err = -ENOIOCTLCMD; 1256 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)
625 return -EINVAL; 625 return -EINVAL;
626} 626}
627 627
628static int __video_do_ioctl(struct inode *inode, struct file *file, 628static int __video_do_ioctl(struct file *file,
629 unsigned int cmd, void *arg) 629 unsigned int cmd, void *arg)
630{ 630{
631 struct video_device *vfd = video_devdata(file); 631 struct video_device *vfd = video_devdata(file);
@@ -675,7 +675,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
675 V4L2 ioctls. 675 V4L2 ioctls.
676 ********************************************************/ 676 ********************************************************/
677 if (_IOC_TYPE(cmd) == 'v' && _IOC_NR(cmd) < BASE_VIDIOCPRIVATE) 677 if (_IOC_TYPE(cmd) == 'v' && _IOC_NR(cmd) < BASE_VIDIOCPRIVATE)
678 return v4l_compat_translate_ioctl(inode, file, cmd, arg, 678 return v4l_compat_translate_ioctl(file, cmd, arg,
679 __video_do_ioctl); 679 __video_do_ioctl);
680#endif 680#endif
681 681
@@ -1832,7 +1832,7 @@ int video_ioctl2(struct inode *inode, struct file *file,
1832 } 1832 }
1833 1833
1834 /* Handles IOCTL */ 1834 /* Handles IOCTL */
1835 err = __video_do_ioctl(inode, file, cmd, parg); 1835 err = __video_do_ioctl(file, cmd, parg);
1836 if (err == -ENOIOCTLCMD) 1836 if (err == -ENOIOCTLCMD)
1837 err = -EINVAL; 1837 err = -EINVAL;
1838 if (is_ext_ctrl) { 1838 if (is_ext_ctrl) {