aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-12-30 05:04:34 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-02 14:11:34 -0500
commit069b747931f13eda289c1d59a09ecc8162281a76 (patch)
tree144b8ebf131eba4f3468d8d3f52bd192bc2e4f76 /drivers/media
parent4ab9203b1b7e45f1beae7eb0c67d663a26257a69 (diff)
V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl.
Since internal to v4l2 the ioctl prototype is the same regardless of it being called through .ioctl or .unlocked_ioctl, we need to convert it all to the long return type of unlocked_ioctl. Thanks to Jean-Francois Moine for posting an initial patch for this and thus bringing it to our attention. Cc: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/saa7146_fops.c2
-rw-r--r--drivers/media/common/saa7146_video.c5
-rw-r--r--drivers/media/dvb/ttpci/av7110_v4l.c2
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c2
-rw-r--r--drivers/media/video/arv.c4
-rw-r--r--drivers/media/video/bw-qcam.c4
-rw-r--r--drivers/media/video/c-qcam.c4
-rw-r--r--drivers/media/video/cpia.c4
-rw-r--r--drivers/media/video/cpia2/cpia2_v4l.c6
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c6
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.h2
-rw-r--r--drivers/media/video/et61x251/et61x251_core.c6
-rw-r--r--drivers/media/video/hexium_gemini.c2
-rw-r--r--drivers/media/video/hexium_orion.c2
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c2
-rw-r--r--drivers/media/video/meye.c2
-rw-r--r--drivers/media/video/msp3400-driver.c2
-rw-r--r--drivers/media/video/mxb.c2
-rw-r--r--drivers/media/video/ov511.c4
-rw-r--r--drivers/media/video/pms.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c16
-rw-r--r--drivers/media/video/pwc/pwc-ctrl.c4
-rw-r--r--drivers/media/video/pwc/pwc-if.c6
-rw-r--r--drivers/media/video/pwc/pwc-v4l.c2
-rw-r--r--drivers/media/video/pwc/pwc.h4
-rw-r--r--drivers/media/video/saa5246a.c6
-rw-r--r--drivers/media/video/saa5249.c6
-rw-r--r--drivers/media/video/se401.c4
-rw-r--r--drivers/media/video/sn9c102/sn9c102_core.c4
-rw-r--r--drivers/media/video/stradis.c2
-rw-r--r--drivers/media/video/stv680.c4
-rw-r--r--drivers/media/video/tda9840.c2
-rw-r--r--drivers/media/video/tea6415c.c2
-rw-r--r--drivers/media/video/tea6420.c2
-rw-r--r--drivers/media/video/tuner-core.c2
-rw-r--r--drivers/media/video/usbvideo/usbvideo.c6
-rw-r--r--drivers/media/video/usbvideo/vicam.c4
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c4
-rw-r--r--drivers/media/video/uvc/uvc_v4l2.c6
-rw-r--r--drivers/media/video/v4l1-compat.c164
-rw-r--r--drivers/media/video/v4l2-compat-ioctl32.c10
-rw-r--r--drivers/media/video/v4l2-ioctl.c14
-rw-r--r--drivers/media/video/vino.c6
-rw-r--r--drivers/media/video/w9966.c6
-rw-r--r--drivers/media/video/w9968cf.c10
-rw-r--r--drivers/media/video/zc0301/zc0301_core.c4
-rw-r--r--drivers/media/video/zoran/zoran_driver.c4
47 files changed, 187 insertions, 184 deletions
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index fad7fd85e5b6..cf06f4d10ad4 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -308,7 +308,7 @@ static int fops_release(struct file *file)
308 return 0; 308 return 0;
309} 309}
310 310
311static int fops_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 311static long fops_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
312{ 312{
313/* 313/*
314 DEB_EE(("file:%p, cmd:%d, arg:%li\n", file, cmd, arg)); 314 DEB_EE(("file:%p, cmd:%d, arg:%li\n", file, cmd, arg));
diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c
index 101b01dbb8ea..6098b626811f 100644
--- a/drivers/media/common/saa7146_video.c
+++ b/drivers/media/common/saa7146_video.c
@@ -834,13 +834,14 @@ 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 file *file, unsigned int cmd, void *arg) 837long 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;
841 struct saa7146_vv *vv = dev->vv_data; 841 struct saa7146_vv *vv = dev->vv_data;
842 842
843 int err = 0, result = 0, ee = 0; 843 long err = 0;
844 int result = 0, ee = 0;
844 845
845 struct saa7146_use_ops *ops; 846 struct saa7146_use_ops *ops;
846 struct videobuf_queue *q; 847 struct videobuf_queue *q;
diff --git a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c
index 315ba6fa0134..c5b9c70563dc 100644
--- a/drivers/media/dvb/ttpci/av7110_v4l.c
+++ b/drivers/media/dvb/ttpci/av7110_v4l.c
@@ -316,7 +316,7 @@ static int av7110_dvb_c_switch(struct saa7146_fh *fh)
316 return 0; 316 return 0;
317} 317}
318 318
319static int av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 319static long av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
320{ 320{
321 struct saa7146_dev *dev = fh->dev; 321 struct saa7146_dev *dev = fh->dev;
322 struct av7110 *av7110 = (struct av7110*) dev->ext_priv; 322 struct av7110 *av7110 = (struct av7110*) dev->ext_priv;
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index f996cef79ec1..4182121d7e5d 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -1493,7 +1493,7 @@ static struct saa7146_extension_ioctls ioctls[] = {
1493 {0, 0} 1493 {0, 0}
1494}; 1494};
1495 1495
1496static int av_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 1496static long av_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
1497{ 1497{
1498 struct saa7146_dev *dev = fh->dev; 1498 struct saa7146_dev *dev = fh->dev;
1499 struct budget_av *budget_av = (struct budget_av *) dev->ext_priv; 1499 struct budget_av *budget_av = (struct budget_av *) dev->ext_priv;
diff --git a/drivers/media/video/arv.c b/drivers/media/video/arv.c
index f18fb7367e9a..d137bac84511 100644
--- a/drivers/media/video/arv.c
+++ b/drivers/media/video/arv.c
@@ -396,7 +396,7 @@ out_up:
396 return ret; 396 return ret;
397} 397}
398 398
399static int ar_do_ioctl(struct file *file, unsigned int cmd, void *arg) 399static long ar_do_ioctl(struct file *file, unsigned int cmd, void *arg)
400{ 400{
401 struct video_device *dev = video_devdata(file); 401 struct video_device *dev = video_devdata(file);
402 struct ar_device *ar = video_get_drvdata(dev); 402 struct ar_device *ar = video_get_drvdata(dev);
@@ -539,7 +539,7 @@ static int ar_do_ioctl(struct file *file, unsigned int cmd, void *arg)
539 return 0; 539 return 0;
540} 540}
541 541
542static int ar_ioctl(struct file *file, unsigned int cmd, 542static long ar_ioctl(struct file *file, unsigned int cmd,
543 unsigned long arg) 543 unsigned long arg)
544{ 544{
545 return video_usercopy(file, cmd, arg, ar_do_ioctl); 545 return video_usercopy(file, cmd, arg, ar_do_ioctl);
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c
index 0b02be57b99c..10dbd4a11b30 100644
--- a/drivers/media/video/bw-qcam.c
+++ b/drivers/media/video/bw-qcam.c
@@ -706,7 +706,7 @@ static long qc_capture(struct qcam_device * q, char __user *buf, unsigned long l
706 * Video4linux interfacing 706 * Video4linux interfacing
707 */ 707 */
708 708
709static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg) 709static long qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
710{ 710{
711 struct video_device *dev = video_devdata(file); 711 struct video_device *dev = video_devdata(file);
712 struct qcam_device *qcam=(struct qcam_device *)dev; 712 struct qcam_device *qcam=(struct qcam_device *)dev;
@@ -863,7 +863,7 @@ static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
863 return 0; 863 return 0;
864} 864}
865 865
866static int qcam_ioctl(struct file *file, 866static long qcam_ioctl(struct file *file,
867 unsigned int cmd, unsigned long arg) 867 unsigned int cmd, unsigned long arg)
868{ 868{
869 return video_usercopy(file, cmd, arg, qcam_do_ioctl); 869 return video_usercopy(file, cmd, arg, qcam_do_ioctl);
diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c
index 837c16df1f51..85cf1778827a 100644
--- a/drivers/media/video/c-qcam.c
+++ b/drivers/media/video/c-qcam.c
@@ -500,7 +500,7 @@ static long qc_capture(struct qcam_device *q, char __user *buf, unsigned long le
500 * Video4linux interfacing 500 * Video4linux interfacing
501 */ 501 */
502 502
503static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg) 503static long qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
504{ 504{
505 struct video_device *dev = video_devdata(file); 505 struct video_device *dev = video_devdata(file);
506 struct qcam_device *qcam=(struct qcam_device *)dev; 506 struct qcam_device *qcam=(struct qcam_device *)dev;
@@ -665,7 +665,7 @@ static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
665 return 0; 665 return 0;
666} 666}
667 667
668static int qcam_ioctl(struct file *file, 668static long qcam_ioctl(struct file *file,
669 unsigned int cmd, unsigned long arg) 669 unsigned int cmd, unsigned long arg)
670{ 670{
671 return video_usercopy(file, cmd, arg, qcam_do_ioctl); 671 return video_usercopy(file, cmd, arg, qcam_do_ioctl);
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index 9925ec0ab29d..c3b0c8c63c76 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -3333,7 +3333,7 @@ static ssize_t cpia_read(struct file *file, char __user *buf,
3333 return cam->decompressed_frame.count; 3333 return cam->decompressed_frame.count;
3334} 3334}
3335 3335
3336static int cpia_do_ioctl(struct file *file, unsigned int cmd, void *arg) 3336static long cpia_do_ioctl(struct file *file, unsigned int cmd, void *arg)
3337{ 3337{
3338 struct video_device *dev = file->private_data; 3338 struct video_device *dev = file->private_data;
3339 struct cam_data *cam = video_get_drvdata(dev); 3339 struct cam_data *cam = video_get_drvdata(dev);
@@ -3720,7 +3720,7 @@ static int cpia_do_ioctl(struct file *file, unsigned int cmd, void *arg)
3720 return retval; 3720 return retval;
3721} 3721}
3722 3722
3723static int cpia_ioctl(struct file *file, 3723static long cpia_ioctl(struct file *file,
3724 unsigned int cmd, unsigned long arg) 3724 unsigned int cmd, unsigned long arg)
3725{ 3725{
3726 return video_usercopy(file, cmd, arg, cpia_do_ioctl); 3726 return video_usercopy(file, cmd, arg, cpia_do_ioctl);
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c
index 91870cc9c445..9c25894fdd8e 100644
--- a/drivers/media/video/cpia2/cpia2_v4l.c
+++ b/drivers/media/video/cpia2/cpia2_v4l.c
@@ -1572,10 +1572,10 @@ static int ioctl_dqbuf(void *arg,struct camera_data *cam, struct file *file)
1572 * cpia2_ioctl 1572 * cpia2_ioctl
1573 * 1573 *
1574 *****************************************************************************/ 1574 *****************************************************************************/
1575static int cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1575static long cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1576{ 1576{
1577 struct camera_data *cam = video_drvdata(file); 1577 struct camera_data *cam = video_drvdata(file);
1578 int retval = 0; 1578 long retval = 0;
1579 1579
1580 if (!cam) 1580 if (!cam)
1581 return -ENOTTY; 1581 return -ENOTTY;
@@ -1841,7 +1841,7 @@ static int cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1841 return retval; 1841 return retval;
1842} 1842}
1843 1843
1844static int cpia2_ioctl(struct file *file, 1844static long cpia2_ioctl(struct file *file,
1845 unsigned int cmd, unsigned long arg) 1845 unsigned int cmd, unsigned long arg)
1846{ 1846{
1847 return video_usercopy(file, cmd, arg, cpia2_do_ioctl); 1847 return video_usercopy(file, cmd, arg, cpia2_do_ioctl);
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index 5023075506fb..8aa152b39545 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -755,7 +755,7 @@ static int cx18_log_status(struct file *file, void *fh)
755 return 0; 755 return 0;
756} 756}
757 757
758static int cx18_default(struct file *file, void *fh, int cmd, void *arg) 758static long cx18_default(struct file *file, void *fh, int cmd, void *arg)
759{ 759{
760 struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; 760 struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
761 761
@@ -783,13 +783,13 @@ static int cx18_default(struct file *file, void *fh, int cmd, void *arg)
783 return 0; 783 return 0;
784} 784}
785 785
786int cx18_v4l2_ioctl(struct file *filp, unsigned int cmd, 786long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
787 unsigned long arg) 787 unsigned long arg)
788{ 788{
789 struct video_device *vfd = video_devdata(filp); 789 struct video_device *vfd = video_devdata(filp);
790 struct cx18_open_id *id = (struct cx18_open_id *)filp->private_data; 790 struct cx18_open_id *id = (struct cx18_open_id *)filp->private_data;
791 struct cx18 *cx = id->cx; 791 struct cx18 *cx = id->cx;
792 int res; 792 long res;
793 793
794 mutex_lock(&cx->serialize_lock); 794 mutex_lock(&cx->serialize_lock);
795 795
diff --git a/drivers/media/video/cx18/cx18-ioctl.h b/drivers/media/video/cx18/cx18-ioctl.h
index 50b8d6056cdf..e2ca0d152116 100644
--- a/drivers/media/video/cx18/cx18-ioctl.h
+++ b/drivers/media/video/cx18/cx18-ioctl.h
@@ -29,5 +29,5 @@ void cx18_set_funcs(struct video_device *vdev);
29int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std); 29int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std);
30int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf); 30int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf);
31int cx18_s_input(struct file *file, void *fh, unsigned int inp); 31int cx18_s_input(struct file *file, void *fh, unsigned int inp);
32int cx18_v4l2_ioctl(struct file *filp, unsigned int cmd, 32long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
33 unsigned long arg); 33 unsigned long arg);
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c
index 3aeb8791a5bd..d1c1e457f0b9 100644
--- a/drivers/media/video/et61x251/et61x251_core.c
+++ b/drivers/media/video/et61x251/et61x251_core.c
@@ -2392,7 +2392,7 @@ et61x251_vidioc_s_parm(struct et61x251_device* cam, void __user * arg)
2392} 2392}
2393 2393
2394 2394
2395static int et61x251_ioctl_v4l2(struct file *filp, 2395static long et61x251_ioctl_v4l2(struct file *filp,
2396 unsigned int cmd, void __user *arg) 2396 unsigned int cmd, void __user *arg)
2397{ 2397{
2398 struct et61x251_device *cam = video_drvdata(filp); 2398 struct et61x251_device *cam = video_drvdata(filp);
@@ -2487,11 +2487,11 @@ static int et61x251_ioctl_v4l2(struct file *filp,
2487} 2487}
2488 2488
2489 2489
2490static int et61x251_ioctl(struct file *filp, 2490static long et61x251_ioctl(struct file *filp,
2491 unsigned int cmd, unsigned long arg) 2491 unsigned int cmd, unsigned long arg)
2492{ 2492{
2493 struct et61x251_device *cam = video_drvdata(filp); 2493 struct et61x251_device *cam = video_drvdata(filp);
2494 int err = 0; 2494 long err = 0;
2495 2495
2496 if (mutex_lock_interruptible(&cam->fileop_mutex)) 2496 if (mutex_lock_interruptible(&cam->fileop_mutex))
2497 return -ERESTARTSYS; 2497 return -ERESTARTSYS;
diff --git a/drivers/media/video/hexium_gemini.c b/drivers/media/video/hexium_gemini.c
index 352f84d440fb..79393d1772e4 100644
--- a/drivers/media/video/hexium_gemini.c
+++ b/drivers/media/video/hexium_gemini.c
@@ -306,7 +306,7 @@ static int hexium_detach(struct saa7146_dev *dev)
306 return 0; 306 return 0;
307} 307}
308 308
309static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 309static long hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
310{ 310{
311 struct saa7146_dev *dev = fh->dev; 311 struct saa7146_dev *dev = fh->dev;
312 struct hexium *hexium = (struct hexium *) dev->ext_priv; 312 struct hexium *hexium = (struct hexium *) dev->ext_priv;
diff --git a/drivers/media/video/hexium_orion.c b/drivers/media/video/hexium_orion.c
index 8d3c1482e7ea..074bec711fe0 100644
--- a/drivers/media/video/hexium_orion.c
+++ b/drivers/media/video/hexium_orion.c
@@ -370,7 +370,7 @@ static int hexium_detach(struct saa7146_dev *dev)
370 return 0; 370 return 0;
371} 371}
372 372
373static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 373static long hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
374{ 374{
375 struct saa7146_dev *dev = fh->dev; 375 struct saa7146_dev *dev = fh->dev;
376 struct hexium *hexium = (struct hexium *) dev->ext_priv; 376 struct hexium *hexium = (struct hexium *) dev->ext_priv;
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index a6cd02460e75..1f6ca93b9840 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1725,7 +1725,7 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg)
1725 return 0; 1725 return 0;
1726} 1726}
1727 1727
1728static int ivtv_default(struct file *file, void *fh, int cmd, void *arg) 1728static long ivtv_default(struct file *file, void *fh, int cmd, void *arg)
1729{ 1729{
1730 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 1730 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
1731 1731
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c
index c408e615c415..b76e33d5c867 100644
--- a/drivers/media/video/meye.c
+++ b/drivers/media/video/meye.c
@@ -1577,7 +1577,7 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)
1577 return 0; 1577 return 0;
1578} 1578}
1579 1579
1580static int vidioc_default(struct file *file, void *fh, int cmd, void *arg) 1580static long vidioc_default(struct file *file, void *fh, int cmd, void *arg)
1581{ 1581{
1582 switch (cmd) { 1582 switch (cmd) {
1583 case MEYEIOC_G_PARAMS: 1583 case MEYEIOC_G_PARAMS:
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index a622dbb72ed8..b8577ade4050 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -483,7 +483,7 @@ static int msp_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
483} 483}
484 484
485#ifdef CONFIG_VIDEO_ALLOW_V4L1 485#ifdef CONFIG_VIDEO_ALLOW_V4L1
486static int msp_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) 486static long msp_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
487{ 487{
488 struct msp_state *state = to_state(sd); 488 struct msp_state *state = to_state(sd);
489 struct i2c_client *client = v4l2_get_subdevdata(sd); 489 struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index 7f130284b5c7..e3cbe14c349a 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -489,7 +489,7 @@ static int mxb_detach(struct saa7146_dev *dev)
489 return 0; 489 return 0;
490} 490}
491 491
492static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 492static long mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
493{ 493{
494 struct saa7146_dev *dev = fh->dev; 494 struct saa7146_dev *dev = fh->dev;
495 struct mxb *mxb = (struct mxb *)dev->ext_priv; 495 struct mxb *mxb = (struct mxb *)dev->ext_priv;
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c
index f1754dc5587e..9af5532db142 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -4010,7 +4010,7 @@ ov51x_v4l1_close(struct file *file)
4010} 4010}
4011 4011
4012/* Do not call this function directly! */ 4012/* Do not call this function directly! */
4013static int 4013static long
4014ov51x_v4l1_ioctl_internal(struct file *file, unsigned int cmd, void *arg) 4014ov51x_v4l1_ioctl_internal(struct file *file, unsigned int cmd, void *arg)
4015{ 4015{
4016 struct video_device *vdev = file->private_data; 4016 struct video_device *vdev = file->private_data;
@@ -4449,7 +4449,7 @@ redo:
4449 return 0; 4449 return 0;
4450} 4450}
4451 4451
4452static int 4452static long
4453ov51x_v4l1_ioctl(struct file *file, 4453ov51x_v4l1_ioctl(struct file *file,
4454 unsigned int cmd, unsigned long arg) 4454 unsigned int cmd, unsigned long arg)
4455{ 4455{
diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c
index 24f2b3d9977f..a1ad38fc49c1 100644
--- a/drivers/media/video/pms.c
+++ b/drivers/media/video/pms.c
@@ -680,7 +680,7 @@ static int pms_capture(struct pms_device *dev, char __user *buf, int rgb555, int
680 * Video4linux interfacing 680 * Video4linux interfacing
681 */ 681 */
682 682
683static int pms_do_ioctl(struct file *file, unsigned int cmd, void *arg) 683static long pms_do_ioctl(struct file *file, unsigned int cmd, void *arg)
684{ 684{
685 struct video_device *dev = video_devdata(file); 685 struct video_device *dev = video_devdata(file);
686 struct pms_device *pd=(struct pms_device *)dev; 686 struct pms_device *pd=(struct pms_device *)dev;
@@ -862,7 +862,7 @@ static int pms_do_ioctl(struct file *file, unsigned int cmd, void *arg)
862 return 0; 862 return 0;
863} 863}
864 864
865static int pms_ioctl(struct file *file, 865static long pms_ioctl(struct file *file,
866 unsigned int cmd, unsigned long arg) 866 unsigned int cmd, unsigned long arg)
867{ 867{
868 return video_usercopy(file, cmd, arg, pms_do_ioctl); 868 return video_usercopy(file, cmd, arg, pms_do_ioctl);
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 50554b44d355..b9aedceb2c44 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -168,13 +168,13 @@ 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 file *file, unsigned int cmd, void *arg) 171static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
172{ 172{
173 struct pvr2_v4l2_fh *fh = file->private_data; 173 struct pvr2_v4l2_fh *fh = file->private_data;
174 struct pvr2_v4l2 *vp = fh->vhead; 174 struct pvr2_v4l2 *vp = fh->vhead;
175 struct pvr2_v4l2_dev *dev_info = fh->dev_info; 175 struct pvr2_v4l2_dev *dev_info = fh->dev_info;
176 struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; 176 struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
177 int ret = -EINVAL; 177 long ret = -EINVAL;
178 178
179 if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) { 179 if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) {
180 v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw),cmd); 180 v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw),cmd);
@@ -871,20 +871,20 @@ static int pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
871 if (ret < 0) { 871 if (ret < 0) {
872 if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) { 872 if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) {
873 pvr2_trace(PVR2_TRACE_V4LIOCTL, 873 pvr2_trace(PVR2_TRACE_V4LIOCTL,
874 "pvr2_v4l2_do_ioctl failure, ret=%d",ret); 874 "pvr2_v4l2_do_ioctl failure, ret=%ld", ret);
875 } else { 875 } else {
876 if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) { 876 if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) {
877 pvr2_trace(PVR2_TRACE_V4LIOCTL, 877 pvr2_trace(PVR2_TRACE_V4LIOCTL,
878 "pvr2_v4l2_do_ioctl failure, ret=%d" 878 "pvr2_v4l2_do_ioctl failure, ret=%ld"
879 " command was:",ret); 879 " command was:", ret);
880 v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw), 880 v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw),
881 cmd); 881 cmd);
882 } 882 }
883 } 883 }
884 } else { 884 } else {
885 pvr2_trace(PVR2_TRACE_V4LIOCTL, 885 pvr2_trace(PVR2_TRACE_V4LIOCTL,
886 "pvr2_v4l2_do_ioctl complete, ret=%d (0x%x)", 886 "pvr2_v4l2_do_ioctl complete, ret=%ld (0x%lx)",
887 ret,ret); 887 ret, ret);
888 } 888 }
889 return ret; 889 return ret;
890} 890}
@@ -948,7 +948,7 @@ static void pvr2_v4l2_internal_check(struct pvr2_channel *chp)
948} 948}
949 949
950 950
951static int pvr2_v4l2_ioctl(struct file *file, 951static long pvr2_v4l2_ioctl(struct file *file,
952 unsigned int cmd, unsigned long arg) 952 unsigned int cmd, unsigned long arg)
953{ 953{
954 954
diff --git a/drivers/media/video/pwc/pwc-ctrl.c b/drivers/media/video/pwc/pwc-ctrl.c
index c66530210192..f9fbe02e0f69 100644
--- a/drivers/media/video/pwc/pwc-ctrl.c
+++ b/drivers/media/video/pwc/pwc-ctrl.c
@@ -1266,9 +1266,9 @@ int pwc_get_cmos_sensor(struct pwc_device *pdev, int *sensor)
1266/* copy local variable to arg */ 1266/* copy local variable to arg */
1267#define ARG_OUT(ARG_name) /* nothing */ 1267#define ARG_OUT(ARG_name) /* nothing */
1268 1268
1269int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg) 1269long pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
1270{ 1270{
1271 int ret = 0; 1271 long ret = 0;
1272 1272
1273 switch(cmd) { 1273 switch(cmd) {
1274 case VIDIOCPWCRUSER: 1274 case VIDIOCPWCRUSER:
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index 315337bfd673..39fbc970f43d 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -147,7 +147,7 @@ static int pwc_video_close(struct file *file);
147static ssize_t pwc_video_read(struct file *file, char __user *buf, 147static ssize_t pwc_video_read(struct file *file, char __user *buf,
148 size_t count, loff_t *ppos); 148 size_t count, loff_t *ppos);
149static unsigned int pwc_video_poll(struct file *file, poll_table *wait); 149static unsigned int pwc_video_poll(struct file *file, poll_table *wait);
150static int pwc_video_ioctl(struct file *file, 150static long pwc_video_ioctl(struct file *file,
151 unsigned int ioctlnr, unsigned long arg); 151 unsigned int ioctlnr, unsigned long arg);
152static int pwc_video_mmap(struct file *file, struct vm_area_struct *vma); 152static int pwc_video_mmap(struct file *file, struct vm_area_struct *vma);
153 153
@@ -1395,12 +1395,12 @@ static unsigned int pwc_video_poll(struct file *file, poll_table *wait)
1395 return 0; 1395 return 0;
1396} 1396}
1397 1397
1398static int pwc_video_ioctl(struct file *file, 1398static long pwc_video_ioctl(struct file *file,
1399 unsigned int cmd, unsigned long arg) 1399 unsigned int cmd, unsigned long arg)
1400{ 1400{
1401 struct video_device *vdev = file->private_data; 1401 struct video_device *vdev = file->private_data;
1402 struct pwc_device *pdev; 1402 struct pwc_device *pdev;
1403 int r = -ENODEV; 1403 long r = -ENODEV;
1404 1404
1405 if (!vdev) 1405 if (!vdev)
1406 goto out; 1406 goto out;
diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l.c
index d7c147328e35..bc0a464295c5 100644
--- a/drivers/media/video/pwc/pwc-v4l.c
+++ b/drivers/media/video/pwc/pwc-v4l.c
@@ -337,7 +337,7 @@ static int pwc_vidioc_set_fmt(struct pwc_device *pdev, struct v4l2_format *f)
337 337
338} 338}
339 339
340int pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg) 340long pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
341{ 341{
342 struct video_device *vdev = video_devdata(file); 342 struct video_device *vdev = video_devdata(file);
343 struct pwc_device *pdev; 343 struct pwc_device *pdev;
diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h
index c046a2535668..01411fb2337a 100644
--- a/drivers/media/video/pwc/pwc.h
+++ b/drivers/media/video/pwc/pwc.h
@@ -337,10 +337,10 @@ extern int pwc_get_dynamic_noise(struct pwc_device *pdev, int *noise);
337extern int pwc_camera_power(struct pwc_device *pdev, int power); 337extern int pwc_camera_power(struct pwc_device *pdev, int power);
338 338
339/* Private ioctl()s; see pwc-ioctl.h */ 339/* Private ioctl()s; see pwc-ioctl.h */
340extern int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg); 340extern long pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg);
341 341
342/** Functions in pwc-v4l.c */ 342/** Functions in pwc-v4l.c */
343extern int pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg); 343extern long pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg);
344 344
345/** pwc-uncompress.c */ 345/** pwc-uncompress.c */
346/* Expand frame to image, possibly including decompression. Uses read_frame and fill_image */ 346/* Expand frame to image, possibly including decompression. Uses read_frame and fill_image */
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index 018dee55b3aa..e637e440b6d5 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -804,7 +804,7 @@ static inline int saa5246a_stop_dau(struct saa5246a_device *t,
804 * 804 *
805 * Returns 0 if successful 805 * Returns 0 if successful
806 */ 806 */
807static int do_saa5246a_ioctl(struct file *file, unsigned int cmd, void *arg) 807static long do_saa5246a_ioctl(struct file *file, unsigned int cmd, void *arg)
808{ 808{
809 struct saa5246a_device *t = video_drvdata(file); 809 struct saa5246a_device *t = video_drvdata(file);
810 810
@@ -944,11 +944,11 @@ static inline unsigned int vtx_fix_command(unsigned int cmd)
944/* 944/*
945 * Handle the locking 945 * Handle the locking
946 */ 946 */
947static int saa5246a_ioctl(struct file *file, 947static long saa5246a_ioctl(struct file *file,
948 unsigned int cmd, unsigned long arg) 948 unsigned int cmd, unsigned long arg)
949{ 949{
950 struct saa5246a_device *t = video_drvdata(file); 950 struct saa5246a_device *t = video_drvdata(file);
951 int err; 951 long err;
952 952
953 cmd = vtx_fix_command(cmd); 953 cmd = vtx_fix_command(cmd);
954 mutex_lock(&t->lock); 954 mutex_lock(&t->lock);
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index e73bb738933c..e29765192469 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -190,7 +190,7 @@ static int i2c_getdata(struct saa5249_device *t, int count, u8 *buf)
190 * Standard character-device-driver functions 190 * Standard character-device-driver functions
191 */ 191 */
192 192
193static int do_saa5249_ioctl(struct file *file, unsigned int cmd, void *arg) 193static long do_saa5249_ioctl(struct file *file, unsigned int cmd, void *arg)
194{ 194{
195 static int virtual_mode = false; 195 static int virtual_mode = false;
196 struct saa5249_device *t = video_drvdata(file); 196 struct saa5249_device *t = video_drvdata(file);
@@ -479,11 +479,11 @@ static inline unsigned int vtx_fix_command(unsigned int cmd)
479 * Handle the locking 479 * Handle the locking
480 */ 480 */
481 481
482static int saa5249_ioctl(struct file *file, 482static long saa5249_ioctl(struct file *file,
483 unsigned int cmd, unsigned long arg) 483 unsigned int cmd, unsigned long arg)
484{ 484{
485 struct saa5249_device *t = video_drvdata(file); 485 struct saa5249_device *t = video_drvdata(file);
486 int err; 486 long err;
487 487
488 cmd = vtx_fix_command(cmd); 488 cmd = vtx_fix_command(cmd);
489 mutex_lock(&t->lock); 489 mutex_lock(&t->lock);
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index 5b27f323272f..5990ab38a124 100644
--- a/drivers/media/video/se401.c
+++ b/drivers/media/video/se401.c
@@ -975,7 +975,7 @@ static int se401_close(struct file *file)
975 return 0; 975 return 0;
976} 976}
977 977
978static int se401_do_ioctl(struct file *file, unsigned int cmd, void *arg) 978static long se401_do_ioctl(struct file *file, unsigned int cmd, void *arg)
979{ 979{
980 struct video_device *vdev = file->private_data; 980 struct video_device *vdev = file->private_data;
981 struct usb_se401 *se401 = (struct usb_se401 *)vdev; 981 struct usb_se401 *se401 = (struct usb_se401 *)vdev;
@@ -1138,7 +1138,7 @@ static int se401_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1138 return 0; 1138 return 0;
1139} 1139}
1140 1140
1141static int se401_ioctl(struct file *file, 1141static long se401_ioctl(struct file *file,
1142 unsigned int cmd, unsigned long arg) 1142 unsigned int cmd, unsigned long arg)
1143{ 1143{
1144 return video_usercopy(file, cmd, arg, se401_do_ioctl); 1144 return video_usercopy(file, cmd, arg, se401_do_ioctl);
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c
index c2582e248fa3..23edfdc4d4bc 100644
--- a/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/drivers/media/video/sn9c102/sn9c102_core.c
@@ -3092,7 +3092,7 @@ sn9c102_vidioc_s_audio(struct sn9c102_device* cam, void __user * arg)
3092} 3092}
3093 3093
3094 3094
3095static int sn9c102_ioctl_v4l2(struct file *filp, 3095static long sn9c102_ioctl_v4l2(struct file *filp,
3096 unsigned int cmd, void __user *arg) 3096 unsigned int cmd, void __user *arg)
3097{ 3097{
3098 struct sn9c102_device *cam = video_drvdata(filp); 3098 struct sn9c102_device *cam = video_drvdata(filp);
@@ -3196,7 +3196,7 @@ static int sn9c102_ioctl_v4l2(struct file *filp,
3196} 3196}
3197 3197
3198 3198
3199static int sn9c102_ioctl(struct file *filp, 3199static long sn9c102_ioctl(struct file *filp,
3200 unsigned int cmd, unsigned long arg) 3200 unsigned int cmd, unsigned long arg)
3201{ 3201{
3202 struct sn9c102_device *cam = video_drvdata(filp); 3202 struct sn9c102_device *cam = video_drvdata(filp);
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
index 10d2608501ae..0eb313082c97 100644
--- a/drivers/media/video/stradis.c
+++ b/drivers/media/video/stradis.c
@@ -1275,7 +1275,7 @@ static void make_clip_tab(struct saa7146 *saa, struct video_clip *cr, int ncr)
1275 clip_draw_rectangle(clipmap, 0, 0, 1024, -saa->win.y); 1275 clip_draw_rectangle(clipmap, 0, 0, 1024, -saa->win.y);
1276} 1276}
1277 1277
1278static int saa_ioctl(struct file *file, 1278static long saa_ioctl(struct file *file,
1279 unsigned int cmd, unsigned long argl) 1279 unsigned int cmd, unsigned long argl)
1280{ 1280{
1281 struct saa7146 *saa = file->private_data; 1281 struct saa7146 *saa = file->private_data;
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 0783b0a23f8a..75f286f7a2e9 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -1132,7 +1132,7 @@ static int stv_close(struct file *file)
1132 return 0; 1132 return 0;
1133} 1133}
1134 1134
1135static int stv680_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1135static long stv680_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1136{ 1136{
1137 struct video_device *vdev = file->private_data; 1137 struct video_device *vdev = file->private_data;
1138 struct usb_stv *stv680 = video_get_drvdata(vdev); 1138 struct usb_stv *stv680 = video_get_drvdata(vdev);
@@ -1299,7 +1299,7 @@ static int stv680_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1299 return 0; 1299 return 0;
1300} 1300}
1301 1301
1302static int stv680_ioctl(struct file *file, 1302static long stv680_ioctl(struct file *file,
1303 unsigned int cmd, unsigned long arg) 1303 unsigned int cmd, unsigned long arg)
1304{ 1304{
1305 return video_usercopy(file, cmd, arg, stv680_do_ioctl); 1305 return video_usercopy(file, cmd, arg, stv680_do_ioctl);
diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c
index 2644e0dc9251..6afb7059502d 100644
--- a/drivers/media/video/tda9840.c
+++ b/drivers/media/video/tda9840.c
@@ -137,7 +137,7 @@ static int tda9840_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *t)
137 return 0; 137 return 0;
138} 138}
139 139
140static int tda9840_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg) 140static long tda9840_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg)
141{ 141{
142 int byte; 142 int byte;
143 143
diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c
index 31dde86f2df4..7519fd1f57ef 100644
--- a/drivers/media/video/tea6415c.c
+++ b/drivers/media/video/tea6415c.c
@@ -122,7 +122,7 @@ static int switch_matrix(struct i2c_client *client, int i, int o)
122 return ret; 122 return ret;
123} 123}
124 124
125static int tea6415c_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg) 125static long tea6415c_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg)
126{ 126{
127 if (cmd == TEA6415C_SWITCH) { 127 if (cmd == TEA6415C_SWITCH) {
128 struct i2c_client *client = v4l2_get_subdevdata(sd); 128 struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c
index 38e519f04bde..081e74fa3b2e 100644
--- a/drivers/media/video/tea6420.c
+++ b/drivers/media/video/tea6420.c
@@ -90,7 +90,7 @@ static int tea6420_switch(struct i2c_client *client, int i, int o, int g)
90 return 0; 90 return 0;
91} 91}
92 92
93static int tea6420_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg) 93static long tea6420_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg)
94{ 94{
95 if (cmd == TEA6420_SWITCH) { 95 if (cmd == TEA6420_SWITCH) {
96 struct i2c_client *client = v4l2_get_subdevdata(sd); 96 struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 97d7509d212f..30640fbfd0f9 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -800,7 +800,7 @@ static int tuner_s_standby(struct v4l2_subdev *sd, u32 standby)
800} 800}
801 801
802#ifdef CONFIG_VIDEO_ALLOW_V4L1 802#ifdef CONFIG_VIDEO_ALLOW_V4L1
803static int tuner_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) 803static long tuner_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
804{ 804{
805 struct tuner *t = to_tuner(sd); 805 struct tuner *t = to_tuner(sd);
806 struct i2c_client *client = v4l2_get_subdevdata(sd); 806 struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c
index 9bf82430eb18..dea8b321fb4a 100644
--- a/drivers/media/video/usbvideo/usbvideo.c
+++ b/drivers/media/video/usbvideo/usbvideo.c
@@ -41,7 +41,7 @@ module_param(video_nr, int, 0);
41static void usbvideo_Disconnect(struct usb_interface *intf); 41static void usbvideo_Disconnect(struct usb_interface *intf);
42static void usbvideo_CameraRelease(struct uvd *uvd); 42static void usbvideo_CameraRelease(struct uvd *uvd);
43 43
44static int usbvideo_v4l_ioctl(struct file *file, 44static long usbvideo_v4l_ioctl(struct file *file,
45 unsigned int cmd, unsigned long arg); 45 unsigned int cmd, unsigned long arg);
46static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma); 46static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma);
47static int usbvideo_v4l_open(struct file *file); 47static int usbvideo_v4l_open(struct file *file);
@@ -1277,7 +1277,7 @@ static int usbvideo_v4l_close(struct file *file)
1277 * History: 1277 * History:
1278 * 22-Jan-2000 Corrected VIDIOCSPICT to reject unsupported settings. 1278 * 22-Jan-2000 Corrected VIDIOCSPICT to reject unsupported settings.
1279 */ 1279 */
1280static int usbvideo_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1280static long usbvideo_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1281{ 1281{
1282 struct uvd *uvd = file->private_data; 1282 struct uvd *uvd = file->private_data;
1283 1283
@@ -1497,7 +1497,7 @@ static int usbvideo_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1497 return 0; 1497 return 0;
1498} 1498}
1499 1499
1500static int usbvideo_v4l_ioctl(struct file *file, 1500static long usbvideo_v4l_ioctl(struct file *file,
1501 unsigned int cmd, unsigned long arg) 1501 unsigned int cmd, unsigned long arg)
1502{ 1502{
1503 return video_usercopy(file, cmd, arg, usbvideo_v4l_do_ioctl); 1503 return video_usercopy(file, cmd, arg, usbvideo_v4l_do_ioctl);
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c
index 53197a4e6b92..2f1106338c08 100644
--- a/drivers/media/video/usbvideo/vicam.c
+++ b/drivers/media/video/usbvideo/vicam.c
@@ -229,12 +229,12 @@ set_camera_power(struct vicam_camera *cam, int state)
229 return 0; 229 return 0;
230} 230}
231 231
232static int 232static long
233vicam_ioctl(struct file *file, unsigned int ioctlnr, unsigned long arg) 233vicam_ioctl(struct file *file, unsigned int ioctlnr, unsigned long arg)
234{ 234{
235 void __user *user_arg = (void __user *)arg; 235 void __user *user_arg = (void __user *)arg;
236 struct vicam_camera *cam = file->private_data; 236 struct vicam_camera *cam = file->private_data;
237 int retval = 0; 237 long retval = 0;
238 238
239 if (!cam) 239 if (!cam)
240 return -ENODEV; 240 return -ENODEV;
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index 21456b862127..7c61c6d5cede 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -1278,14 +1278,14 @@ static int usbvision_vbi_close(struct file *file)
1278 return -ENODEV; 1278 return -ENODEV;
1279} 1279}
1280 1280
1281static int usbvision_do_vbi_ioctl(struct file *file, 1281static long usbvision_do_vbi_ioctl(struct file *file,
1282 unsigned int cmd, void *arg) 1282 unsigned int cmd, void *arg)
1283{ 1283{
1284 /* TODO */ 1284 /* TODO */
1285 return -ENOIOCTLCMD; 1285 return -ENOIOCTLCMD;
1286} 1286}
1287 1287
1288static int usbvision_vbi_ioctl(struct file *file, 1288static long usbvision_vbi_ioctl(struct file *file,
1289 unsigned int cmd, unsigned long arg) 1289 unsigned int cmd, unsigned long arg)
1290{ 1290{
1291 return video_usercopy(file, cmd, arg, usbvision_do_vbi_ioctl); 1291 return video_usercopy(file, cmd, arg, usbvision_do_vbi_ioctl);
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index df9e937626ef..fa150fff2c10 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -472,12 +472,12 @@ static int uvc_v4l2_release(struct file *file)
472 return 0; 472 return 0;
473} 473}
474 474
475static int uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) 475static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
476{ 476{
477 struct video_device *vdev = video_devdata(file); 477 struct video_device *vdev = video_devdata(file);
478 struct uvc_video_device *video = video_get_drvdata(vdev); 478 struct uvc_video_device *video = video_get_drvdata(vdev);
479 struct uvc_fh *handle = (struct uvc_fh *)file->private_data; 479 struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
480 int ret = 0; 480 long ret = 0;
481 481
482 switch (cmd) { 482 switch (cmd) {
483 /* Query capabilities */ 483 /* Query capabilities */
@@ -996,7 +996,7 @@ static int uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
996 return ret; 996 return ret;
997} 997}
998 998
999static int uvc_v4l2_ioctl(struct file *file, 999static long uvc_v4l2_ioctl(struct file *file,
1000 unsigned int cmd, unsigned long arg) 1000 unsigned int cmd, unsigned long arg)
1001{ 1001{
1002 if (uvc_trace_param & UVC_TRACE_IOCTL) { 1002 if (uvc_trace_param & UVC_TRACE_IOCTL) {
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c
index f13c0a9d684f..d450cab20be4 100644
--- a/drivers/media/video/v4l1-compat.c
+++ b/drivers/media/video/v4l1-compat.c
@@ -267,12 +267,12 @@ done:
267 267
268/* ----------------------------------------------------------------- */ 268/* ----------------------------------------------------------------- */
269 269
270static noinline int v4l1_compat_get_capabilities( 270static noinline long v4l1_compat_get_capabilities(
271 struct video_capability *cap, 271 struct video_capability *cap,
272 struct file *file, 272 struct file *file,
273 v4l2_kioctl drv) 273 v4l2_kioctl drv)
274{ 274{
275 int err; 275 long err;
276 struct v4l2_framebuffer fbuf; 276 struct v4l2_framebuffer fbuf;
277 struct v4l2_capability *cap2; 277 struct v4l2_capability *cap2;
278 278
@@ -286,13 +286,13 @@ static noinline int v4l1_compat_get_capabilities(
286 286
287 err = drv(file, VIDIOC_QUERYCAP, cap2); 287 err = drv(file, VIDIOC_QUERYCAP, cap2);
288 if (err < 0) { 288 if (err < 0) {
289 dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err); 289 dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %ld\n", err);
290 goto done; 290 goto done;
291 } 291 }
292 if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) { 292 if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) {
293 err = drv(file, VIDIOC_G_FBUF, &fbuf); 293 err = drv(file, VIDIOC_G_FBUF, &fbuf);
294 if (err < 0) { 294 if (err < 0) {
295 dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err); 295 dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %ld\n", err);
296 memset(&fbuf, 0, sizeof(fbuf)); 296 memset(&fbuf, 0, sizeof(fbuf));
297 } 297 }
298 err = 0; 298 err = 0;
@@ -324,12 +324,12 @@ done:
324 return err; 324 return err;
325} 325}
326 326
327static noinline int v4l1_compat_get_frame_buffer( 327static noinline long v4l1_compat_get_frame_buffer(
328 struct video_buffer *buffer, 328 struct video_buffer *buffer,
329 struct file *file, 329 struct file *file,
330 v4l2_kioctl drv) 330 v4l2_kioctl drv)
331{ 331{
332 int err; 332 long err;
333 struct v4l2_framebuffer fbuf; 333 struct v4l2_framebuffer fbuf;
334 334
335 memset(buffer, 0, sizeof(*buffer)); 335 memset(buffer, 0, sizeof(*buffer));
@@ -337,7 +337,7 @@ static noinline int v4l1_compat_get_frame_buffer(
337 337
338 err = drv(file, VIDIOC_G_FBUF, &fbuf); 338 err = drv(file, VIDIOC_G_FBUF, &fbuf);
339 if (err < 0) { 339 if (err < 0) {
340 dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err); 340 dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %ld\n", err);
341 goto done; 341 goto done;
342 } 342 }
343 buffer->base = fbuf.base; 343 buffer->base = fbuf.base;
@@ -378,12 +378,12 @@ done:
378 return err; 378 return err;
379} 379}
380 380
381static noinline int v4l1_compat_set_frame_buffer( 381static noinline long v4l1_compat_set_frame_buffer(
382 struct video_buffer *buffer, 382 struct video_buffer *buffer,
383 struct file *file, 383 struct file *file,
384 v4l2_kioctl drv) 384 v4l2_kioctl drv)
385{ 385{
386 int err; 386 long err;
387 struct v4l2_framebuffer fbuf; 387 struct v4l2_framebuffer fbuf;
388 388
389 memset(&fbuf, 0, sizeof(fbuf)); 389 memset(&fbuf, 0, sizeof(fbuf));
@@ -410,16 +410,16 @@ static noinline int v4l1_compat_set_frame_buffer(
410 fbuf.fmt.bytesperline = buffer->bytesperline; 410 fbuf.fmt.bytesperline = buffer->bytesperline;
411 err = drv(file, VIDIOC_S_FBUF, &fbuf); 411 err = drv(file, VIDIOC_S_FBUF, &fbuf);
412 if (err < 0) 412 if (err < 0)
413 dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err); 413 dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %ld\n", err);
414 return err; 414 return err;
415} 415}
416 416
417static noinline int v4l1_compat_get_win_cap_dimensions( 417static noinline long v4l1_compat_get_win_cap_dimensions(
418 struct video_window *win, 418 struct video_window *win,
419 struct file *file, 419 struct file *file,
420 v4l2_kioctl drv) 420 v4l2_kioctl drv)
421{ 421{
422 int err; 422 long err;
423 struct v4l2_format *fmt; 423 struct v4l2_format *fmt;
424 424
425 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL); 425 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL);
@@ -432,7 +432,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
432 fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; 432 fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
433 err = drv(file, VIDIOC_G_FMT, fmt); 433 err = drv(file, VIDIOC_G_FMT, fmt);
434 if (err < 0) 434 if (err < 0)
435 dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err); 435 dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %ld\n", err);
436 if (err == 0) { 436 if (err == 0) {
437 win->x = fmt->fmt.win.w.left; 437 win->x = fmt->fmt.win.w.left;
438 win->y = fmt->fmt.win.w.top; 438 win->y = fmt->fmt.win.w.top;
@@ -447,7 +447,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
447 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 447 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
448 err = drv(file, VIDIOC_G_FMT, fmt); 448 err = drv(file, VIDIOC_G_FMT, fmt);
449 if (err < 0) { 449 if (err < 0) {
450 dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err); 450 dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %ld\n", err);
451 goto done; 451 goto done;
452 } 452 }
453 win->x = 0; 453 win->x = 0;
@@ -462,12 +462,12 @@ done:
462 return err; 462 return err;
463} 463}
464 464
465static noinline int v4l1_compat_set_win_cap_dimensions( 465static noinline long v4l1_compat_set_win_cap_dimensions(
466 struct video_window *win, 466 struct video_window *win,
467 struct file *file, 467 struct file *file,
468 v4l2_kioctl drv) 468 v4l2_kioctl drv)
469{ 469{
470 int err, err1, err2; 470 long err, err1, err2;
471 struct v4l2_format *fmt; 471 struct v4l2_format *fmt;
472 472
473 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL); 473 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL);
@@ -479,7 +479,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
479 drv(file, VIDIOC_STREAMOFF, &fmt->type); 479 drv(file, VIDIOC_STREAMOFF, &fmt->type);
480 err1 = drv(file, VIDIOC_G_FMT, fmt); 480 err1 = drv(file, VIDIOC_G_FMT, fmt);
481 if (err1 < 0) 481 if (err1 < 0)
482 dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1); 482 dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %ld\n", err1);
483 if (err1 == 0) { 483 if (err1 == 0) {
484 fmt->fmt.pix.width = win->width; 484 fmt->fmt.pix.width = win->width;
485 fmt->fmt.pix.height = win->height; 485 fmt->fmt.pix.height = win->height;
@@ -487,7 +487,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
487 fmt->fmt.pix.bytesperline = 0; 487 fmt->fmt.pix.bytesperline = 0;
488 err = drv(file, VIDIOC_S_FMT, fmt); 488 err = drv(file, VIDIOC_S_FMT, fmt);
489 if (err < 0) 489 if (err < 0)
490 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n", 490 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %ld\n",
491 err); 491 err);
492 win->width = fmt->fmt.pix.width; 492 win->width = fmt->fmt.pix.width;
493 win->height = fmt->fmt.pix.height; 493 win->height = fmt->fmt.pix.height;
@@ -504,7 +504,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
504 fmt->fmt.win.clipcount = win->clipcount; 504 fmt->fmt.win.clipcount = win->clipcount;
505 err2 = drv(file, VIDIOC_S_FMT, fmt); 505 err2 = drv(file, VIDIOC_S_FMT, fmt);
506 if (err2 < 0) 506 if (err2 < 0)
507 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2); 507 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %ld\n", err2);
508 508
509 if (err1 != 0 && err2 != 0) 509 if (err1 != 0 && err2 != 0)
510 err = err1; 510 err = err1;
@@ -514,12 +514,12 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
514 return err; 514 return err;
515} 515}
516 516
517static noinline int v4l1_compat_turn_preview_on_off( 517static noinline long v4l1_compat_turn_preview_on_off(
518 int *on, 518 int *on,
519 struct file *file, 519 struct file *file,
520 v4l2_kioctl drv) 520 v4l2_kioctl drv)
521{ 521{
522 int err; 522 long err;
523 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE; 523 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
524 524
525 if (0 == *on) { 525 if (0 == *on) {
@@ -530,16 +530,16 @@ static noinline int v4l1_compat_turn_preview_on_off(
530 } 530 }
531 err = drv(file, VIDIOC_OVERLAY, on); 531 err = drv(file, VIDIOC_OVERLAY, on);
532 if (err < 0) 532 if (err < 0)
533 dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err); 533 dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %ld\n", err);
534 return err; 534 return err;
535} 535}
536 536
537static noinline int v4l1_compat_get_input_info( 537static noinline long v4l1_compat_get_input_info(
538 struct video_channel *chan, 538 struct video_channel *chan,
539 struct file *file, 539 struct file *file,
540 v4l2_kioctl drv) 540 v4l2_kioctl drv)
541{ 541{
542 int err; 542 long err;
543 struct v4l2_input input2; 543 struct v4l2_input input2;
544 v4l2_std_id sid; 544 v4l2_std_id sid;
545 545
@@ -548,7 +548,7 @@ static noinline int v4l1_compat_get_input_info(
548 err = drv(file, VIDIOC_ENUMINPUT, &input2); 548 err = drv(file, VIDIOC_ENUMINPUT, &input2);
549 if (err < 0) { 549 if (err < 0) {
550 dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: " 550 dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: "
551 "channel=%d err=%d\n", chan->channel, err); 551 "channel=%d err=%ld\n", chan->channel, err);
552 goto done; 552 goto done;
553 } 553 }
554 chan->channel = input2.index; 554 chan->channel = input2.index;
@@ -569,7 +569,7 @@ static noinline int v4l1_compat_get_input_info(
569 chan->norm = 0; 569 chan->norm = 0;
570 err = drv(file, VIDIOC_G_STD, &sid); 570 err = drv(file, VIDIOC_G_STD, &sid);
571 if (err < 0) 571 if (err < 0)
572 dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err); 572 dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %ld\n", err);
573 if (err == 0) { 573 if (err == 0) {
574 if (sid & V4L2_STD_PAL) 574 if (sid & V4L2_STD_PAL)
575 chan->norm = VIDEO_MODE_PAL; 575 chan->norm = VIDEO_MODE_PAL;
@@ -582,17 +582,17 @@ done:
582 return err; 582 return err;
583} 583}
584 584
585static noinline int v4l1_compat_set_input( 585static noinline long v4l1_compat_set_input(
586 struct video_channel *chan, 586 struct video_channel *chan,
587 struct file *file, 587 struct file *file,
588 v4l2_kioctl drv) 588 v4l2_kioctl drv)
589{ 589{
590 int err; 590 long err;
591 v4l2_std_id sid = 0; 591 v4l2_std_id sid = 0;
592 592
593 err = drv(file, VIDIOC_S_INPUT, &chan->channel); 593 err = drv(file, VIDIOC_S_INPUT, &chan->channel);
594 if (err < 0) 594 if (err < 0)
595 dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err); 595 dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %ld\n", err);
596 switch (chan->norm) { 596 switch (chan->norm) {
597 case VIDEO_MODE_PAL: 597 case VIDEO_MODE_PAL:
598 sid = V4L2_STD_PAL; 598 sid = V4L2_STD_PAL;
@@ -607,17 +607,17 @@ static noinline int v4l1_compat_set_input(
607 if (0 != sid) { 607 if (0 != sid) {
608 err = drv(file, VIDIOC_S_STD, &sid); 608 err = drv(file, VIDIOC_S_STD, &sid);
609 if (err < 0) 609 if (err < 0)
610 dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err); 610 dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %ld\n", err);
611 } 611 }
612 return err; 612 return err;
613} 613}
614 614
615static noinline int v4l1_compat_get_picture( 615static noinline long v4l1_compat_get_picture(
616 struct video_picture *pict, 616 struct video_picture *pict,
617 struct file *file, 617 struct file *file,
618 v4l2_kioctl drv) 618 v4l2_kioctl drv)
619{ 619{
620 int err; 620 long err;
621 struct v4l2_format *fmt; 621 struct v4l2_format *fmt;
622 622
623 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL); 623 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL);
@@ -640,7 +640,7 @@ static noinline int v4l1_compat_get_picture(
640 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 640 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
641 err = drv(file, VIDIOC_G_FMT, fmt); 641 err = drv(file, VIDIOC_G_FMT, fmt);
642 if (err < 0) { 642 if (err < 0) {
643 dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err); 643 dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %ld\n", err);
644 goto done; 644 goto done;
645 } 645 }
646 646
@@ -654,12 +654,12 @@ done:
654 return err; 654 return err;
655} 655}
656 656
657static noinline int v4l1_compat_set_picture( 657static noinline long v4l1_compat_set_picture(
658 struct video_picture *pict, 658 struct video_picture *pict,
659 struct file *file, 659 struct file *file,
660 v4l2_kioctl drv) 660 v4l2_kioctl drv)
661{ 661{
662 int err; 662 long err;
663 struct v4l2_framebuffer fbuf; 663 struct v4l2_framebuffer fbuf;
664 int mem_err = 0, ovl_err = 0; 664 int mem_err = 0, ovl_err = 0;
665 struct v4l2_format *fmt; 665 struct v4l2_format *fmt;
@@ -694,7 +694,7 @@ static noinline int v4l1_compat_set_picture(
694 support memory capture. Trying to set the memory capture 694 support memory capture. Trying to set the memory capture
695 parameters would be pointless. */ 695 parameters would be pointless. */
696 if (err < 0) { 696 if (err < 0) {
697 dprintk("VIDIOCSPICT / VIDIOC_G_FMT: %d\n", err); 697 dprintk("VIDIOCSPICT / VIDIOC_G_FMT: %ld\n", err);
698 mem_err = -1000; /* didn't even try */ 698 mem_err = -1000; /* didn't even try */
699 } else if (fmt->fmt.pix.pixelformat != 699 } else if (fmt->fmt.pix.pixelformat !=
700 palette_to_pixelformat(pict->palette)) { 700 palette_to_pixelformat(pict->palette)) {
@@ -711,7 +711,7 @@ static noinline int v4l1_compat_set_picture(
711 support overlay. Trying to set the overlay parameters 711 support overlay. Trying to set the overlay parameters
712 would be quite pointless. */ 712 would be quite pointless. */
713 if (err < 0) { 713 if (err < 0) {
714 dprintk("VIDIOCSPICT / VIDIOC_G_FBUF: %d\n", err); 714 dprintk("VIDIOCSPICT / VIDIOC_G_FBUF: %ld\n", err);
715 ovl_err = -1000; /* didn't even try */ 715 ovl_err = -1000; /* didn't even try */
716 } else if (fbuf.fmt.pixelformat != 716 } else if (fbuf.fmt.pixelformat !=
717 palette_to_pixelformat(pict->palette)) { 717 palette_to_pixelformat(pict->palette)) {
@@ -736,12 +736,13 @@ static noinline int v4l1_compat_set_picture(
736 return err; 736 return err;
737} 737}
738 738
739static noinline int v4l1_compat_get_tuner( 739static noinline long v4l1_compat_get_tuner(
740 struct video_tuner *tun, 740 struct video_tuner *tun,
741 struct file *file, 741 struct file *file,
742 v4l2_kioctl drv) 742 v4l2_kioctl drv)
743{ 743{
744 int err, i; 744 long err;
745 int i;
745 struct v4l2_tuner tun2; 746 struct v4l2_tuner tun2;
746 struct v4l2_standard std2; 747 struct v4l2_standard std2;
747 v4l2_std_id sid; 748 v4l2_std_id sid;
@@ -749,7 +750,7 @@ static noinline int v4l1_compat_get_tuner(
749 memset(&tun2, 0, sizeof(tun2)); 750 memset(&tun2, 0, sizeof(tun2));
750 err = drv(file, VIDIOC_G_TUNER, &tun2); 751 err = drv(file, VIDIOC_G_TUNER, &tun2);
751 if (err < 0) { 752 if (err < 0) {
752 dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err); 753 dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %ld\n", err);
753 goto done; 754 goto done;
754 } 755 }
755 memcpy(tun->name, tun2.name, 756 memcpy(tun->name, tun2.name,
@@ -775,7 +776,7 @@ static noinline int v4l1_compat_get_tuner(
775 776
776 err = drv(file, VIDIOC_G_STD, &sid); 777 err = drv(file, VIDIOC_G_STD, &sid);
777 if (err < 0) 778 if (err < 0)
778 dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err); 779 dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %ld\n", err);
779 if (err == 0) { 780 if (err == 0) {
780 if (sid & V4L2_STD_PAL) 781 if (sid & V4L2_STD_PAL)
781 tun->mode = VIDEO_MODE_PAL; 782 tun->mode = VIDEO_MODE_PAL;
@@ -794,12 +795,12 @@ done:
794 return err; 795 return err;
795} 796}
796 797
797static noinline int v4l1_compat_select_tuner( 798static noinline long v4l1_compat_select_tuner(
798 struct video_tuner *tun, 799 struct video_tuner *tun,
799 struct file *file, 800 struct file *file,
800 v4l2_kioctl drv) 801 v4l2_kioctl drv)
801{ 802{
802 int err; 803 long err;
803 struct v4l2_tuner t;/*84 bytes on x86_64*/ 804 struct v4l2_tuner t;/*84 bytes on x86_64*/
804 memset(&t, 0, sizeof(t)); 805 memset(&t, 0, sizeof(t));
805 806
@@ -807,34 +808,34 @@ static noinline int v4l1_compat_select_tuner(
807 808
808 err = drv(file, VIDIOC_S_INPUT, &t); 809 err = drv(file, VIDIOC_S_INPUT, &t);
809 if (err < 0) 810 if (err < 0)
810 dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err); 811 dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %ld\n", err);
811 return err; 812 return err;
812} 813}
813 814
814static noinline int v4l1_compat_get_frequency( 815static noinline long v4l1_compat_get_frequency(
815 unsigned long *freq, 816 unsigned long *freq,
816 struct file *file, 817 struct file *file,
817 v4l2_kioctl drv) 818 v4l2_kioctl drv)
818{ 819{
819 int err; 820 long err;
820 struct v4l2_frequency freq2; 821 struct v4l2_frequency freq2;
821 memset(&freq2, 0, sizeof(freq2)); 822 memset(&freq2, 0, sizeof(freq2));
822 823
823 freq2.tuner = 0; 824 freq2.tuner = 0;
824 err = drv(file, VIDIOC_G_FREQUENCY, &freq2); 825 err = drv(file, VIDIOC_G_FREQUENCY, &freq2);
825 if (err < 0) 826 if (err < 0)
826 dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err); 827 dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %ld\n", err);
827 if (0 == err) 828 if (0 == err)
828 *freq = freq2.frequency; 829 *freq = freq2.frequency;
829 return err; 830 return err;
830} 831}
831 832
832static noinline int v4l1_compat_set_frequency( 833static noinline long v4l1_compat_set_frequency(
833 unsigned long *freq, 834 unsigned long *freq,
834 struct file *file, 835 struct file *file,
835 v4l2_kioctl drv) 836 v4l2_kioctl drv)
836{ 837{
837 int err; 838 long err;
838 struct v4l2_frequency freq2; 839 struct v4l2_frequency freq2;
839 memset(&freq2, 0, sizeof(freq2)); 840 memset(&freq2, 0, sizeof(freq2));
840 841
@@ -842,16 +843,17 @@ static noinline int v4l1_compat_set_frequency(
842 freq2.frequency = *freq; 843 freq2.frequency = *freq;
843 err = drv(file, VIDIOC_S_FREQUENCY, &freq2); 844 err = drv(file, VIDIOC_S_FREQUENCY, &freq2);
844 if (err < 0) 845 if (err < 0)
845 dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err); 846 dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %ld\n", err);
846 return err; 847 return err;
847} 848}
848 849
849static noinline int v4l1_compat_get_audio( 850static noinline long v4l1_compat_get_audio(
850 struct video_audio *aud, 851 struct video_audio *aud,
851 struct file *file, 852 struct file *file,
852 v4l2_kioctl drv) 853 v4l2_kioctl drv)
853{ 854{
854 int err, i; 855 long err;
856 int i;
855 struct v4l2_queryctrl qctrl2; 857 struct v4l2_queryctrl qctrl2;
856 struct v4l2_audio aud2; 858 struct v4l2_audio aud2;
857 struct v4l2_tuner tun2; 859 struct v4l2_tuner tun2;
@@ -859,7 +861,7 @@ static noinline int v4l1_compat_get_audio(
859 861
860 err = drv(file, VIDIOC_G_AUDIO, &aud2); 862 err = drv(file, VIDIOC_G_AUDIO, &aud2);
861 if (err < 0) { 863 if (err < 0) {
862 dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err); 864 dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %ld\n", err);
863 goto done; 865 goto done;
864 } 866 }
865 memcpy(aud->name, aud2.name, 867 memcpy(aud->name, aud2.name,
@@ -903,7 +905,7 @@ static noinline int v4l1_compat_get_audio(
903 memset(&tun2, 0, sizeof(tun2)); 905 memset(&tun2, 0, sizeof(tun2));
904 err = drv(file, VIDIOC_G_TUNER, &tun2); 906 err = drv(file, VIDIOC_G_TUNER, &tun2);
905 if (err < 0) { 907 if (err < 0) {
906 dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err); 908 dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %ld\n", err);
907 err = 0; 909 err = 0;
908 goto done; 910 goto done;
909 } 911 }
@@ -918,12 +920,12 @@ done:
918 return err; 920 return err;
919} 921}
920 922
921static noinline int v4l1_compat_set_audio( 923static noinline long v4l1_compat_set_audio(
922 struct video_audio *aud, 924 struct video_audio *aud,
923 struct file *file, 925 struct file *file,
924 v4l2_kioctl drv) 926 v4l2_kioctl drv)
925{ 927{
926 int err; 928 long err;
927 struct v4l2_audio aud2; 929 struct v4l2_audio aud2;
928 struct v4l2_tuner tun2; 930 struct v4l2_tuner tun2;
929 931
@@ -933,7 +935,7 @@ static noinline int v4l1_compat_set_audio(
933 aud2.index = aud->audio; 935 aud2.index = aud->audio;
934 err = drv(file, VIDIOC_S_AUDIO, &aud2); 936 err = drv(file, VIDIOC_S_AUDIO, &aud2);
935 if (err < 0) { 937 if (err < 0) {
936 dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err); 938 dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %ld\n", err);
937 goto done; 939 goto done;
938 } 940 }
939 941
@@ -950,7 +952,7 @@ static noinline int v4l1_compat_set_audio(
950 952
951 err = drv(file, VIDIOC_G_TUNER, &tun2); 953 err = drv(file, VIDIOC_G_TUNER, &tun2);
952 if (err < 0) 954 if (err < 0)
953 dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err); 955 dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %ld\n", err);
954 if (err == 0) { 956 if (err == 0) {
955 switch (aud->mode) { 957 switch (aud->mode) {
956 default: 958 default:
@@ -967,19 +969,19 @@ static noinline int v4l1_compat_set_audio(
967 } 969 }
968 err = drv(file, VIDIOC_S_TUNER, &tun2); 970 err = drv(file, VIDIOC_S_TUNER, &tun2);
969 if (err < 0) 971 if (err < 0)
970 dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err); 972 dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %ld\n", err);
971 } 973 }
972 err = 0; 974 err = 0;
973done: 975done:
974 return err; 976 return err;
975} 977}
976 978
977static noinline int v4l1_compat_capture_frame( 979static noinline long v4l1_compat_capture_frame(
978 struct video_mmap *mm, 980 struct video_mmap *mm,
979 struct file *file, 981 struct file *file,
980 v4l2_kioctl drv) 982 v4l2_kioctl drv)
981{ 983{
982 int err; 984 long err;
983 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE; 985 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
984 struct v4l2_buffer buf; 986 struct v4l2_buffer buf;
985 struct v4l2_format *fmt; 987 struct v4l2_format *fmt;
@@ -994,7 +996,7 @@ static noinline int v4l1_compat_capture_frame(
994 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 996 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
995 err = drv(file, VIDIOC_G_FMT, fmt); 997 err = drv(file, VIDIOC_G_FMT, fmt);
996 if (err < 0) { 998 if (err < 0) {
997 dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err); 999 dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %ld\n", err);
998 goto done; 1000 goto done;
999 } 1001 }
1000 if (mm->width != fmt->fmt.pix.width || 1002 if (mm->width != fmt->fmt.pix.width ||
@@ -1010,7 +1012,7 @@ static noinline int v4l1_compat_capture_frame(
1010 fmt->fmt.pix.bytesperline = 0; 1012 fmt->fmt.pix.bytesperline = 0;
1011 err = drv(file, VIDIOC_S_FMT, fmt); 1013 err = drv(file, VIDIOC_S_FMT, fmt);
1012 if (err < 0) { 1014 if (err < 0) {
1013 dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err); 1015 dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %ld\n", err);
1014 goto done; 1016 goto done;
1015 } 1017 }
1016 } 1018 }
@@ -1018,28 +1020,28 @@ static noinline int v4l1_compat_capture_frame(
1018 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1020 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1019 err = drv(file, VIDIOC_QUERYBUF, &buf); 1021 err = drv(file, VIDIOC_QUERYBUF, &buf);
1020 if (err < 0) { 1022 if (err < 0) {
1021 dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err); 1023 dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %ld\n", err);
1022 goto done; 1024 goto done;
1023 } 1025 }
1024 err = drv(file, VIDIOC_QBUF, &buf); 1026 err = drv(file, VIDIOC_QBUF, &buf);
1025 if (err < 0) { 1027 if (err < 0) {
1026 dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err); 1028 dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %ld\n", err);
1027 goto done; 1029 goto done;
1028 } 1030 }
1029 err = drv(file, VIDIOC_STREAMON, &captype); 1031 err = drv(file, VIDIOC_STREAMON, &captype);
1030 if (err < 0) 1032 if (err < 0)
1031 dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err); 1033 dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %ld\n", err);
1032done: 1034done:
1033 kfree(fmt); 1035 kfree(fmt);
1034 return err; 1036 return err;
1035} 1037}
1036 1038
1037static noinline int v4l1_compat_sync( 1039static noinline long v4l1_compat_sync(
1038 int *i, 1040 int *i,
1039 struct file *file, 1041 struct file *file,
1040 v4l2_kioctl drv) 1042 v4l2_kioctl drv)
1041{ 1043{
1042 int err; 1044 long err;
1043 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1045 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1044 struct v4l2_buffer buf; 1046 struct v4l2_buffer buf;
1045 struct poll_wqueues *pwq; 1047 struct poll_wqueues *pwq;
@@ -1050,7 +1052,7 @@ static noinline int v4l1_compat_sync(
1050 err = drv(file, VIDIOC_QUERYBUF, &buf); 1052 err = drv(file, VIDIOC_QUERYBUF, &buf);
1051 if (err < 0) { 1053 if (err < 0) {
1052 /* No such buffer */ 1054 /* No such buffer */
1053 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); 1055 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %ld\n", err);
1054 goto done; 1056 goto done;
1055 } 1057 }
1056 if (!(buf.flags & V4L2_BUF_FLAG_MAPPED)) { 1058 if (!(buf.flags & V4L2_BUF_FLAG_MAPPED)) {
@@ -1062,7 +1064,7 @@ static noinline int v4l1_compat_sync(
1062 /* make sure capture actually runs so we don't block forever */ 1064 /* make sure capture actually runs so we don't block forever */
1063 err = drv(file, VIDIOC_STREAMON, &captype); 1065 err = drv(file, VIDIOC_STREAMON, &captype);
1064 if (err < 0) { 1066 if (err < 0) {
1065 dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err); 1067 dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %ld\n", err);
1066 goto done; 1068 goto done;
1067 } 1069 }
1068 1070
@@ -1076,7 +1078,7 @@ static noinline int v4l1_compat_sync(
1076 break; 1078 break;
1077 err = drv(file, VIDIOC_QUERYBUF, &buf); 1079 err = drv(file, VIDIOC_QUERYBUF, &buf);
1078 if (err < 0) 1080 if (err < 0)
1079 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); 1081 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %ld\n", err);
1080 } 1082 }
1081 kfree(pwq); 1083 kfree(pwq);
1082 if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */ 1084 if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */
@@ -1084,18 +1086,18 @@ static noinline int v4l1_compat_sync(
1084 do { 1086 do {
1085 err = drv(file, VIDIOC_DQBUF, &buf); 1087 err = drv(file, VIDIOC_DQBUF, &buf);
1086 if (err < 0) 1088 if (err < 0)
1087 dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err); 1089 dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %ld\n", err);
1088 } while (err == 0 && buf.index != *i); 1090 } while (err == 0 && buf.index != *i);
1089done: 1091done:
1090 return err; 1092 return err;
1091} 1093}
1092 1094
1093static noinline int v4l1_compat_get_vbi_format( 1095static noinline long v4l1_compat_get_vbi_format(
1094 struct vbi_format *fmt, 1096 struct vbi_format *fmt,
1095 struct file *file, 1097 struct file *file,
1096 v4l2_kioctl drv) 1098 v4l2_kioctl drv)
1097{ 1099{
1098 int err; 1100 long err;
1099 struct v4l2_format *fmt2; 1101 struct v4l2_format *fmt2;
1100 1102
1101 fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL); 1103 fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
@@ -1107,7 +1109,7 @@ static noinline int v4l1_compat_get_vbi_format(
1107 1109
1108 err = drv(file, VIDIOC_G_FMT, fmt2); 1110 err = drv(file, VIDIOC_G_FMT, fmt2);
1109 if (err < 0) { 1111 if (err < 0) {
1110 dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err); 1112 dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %ld\n", err);
1111 goto done; 1113 goto done;
1112 } 1114 }
1113 if (fmt2->fmt.vbi.sample_format != V4L2_PIX_FMT_GREY) { 1115 if (fmt2->fmt.vbi.sample_format != V4L2_PIX_FMT_GREY) {
@@ -1128,12 +1130,12 @@ done:
1128 return err; 1130 return err;
1129} 1131}
1130 1132
1131static noinline int v4l1_compat_set_vbi_format( 1133static noinline long v4l1_compat_set_vbi_format(
1132 struct vbi_format *fmt, 1134 struct vbi_format *fmt,
1133 struct file *file, 1135 struct file *file,
1134 v4l2_kioctl drv) 1136 v4l2_kioctl drv)
1135{ 1137{
1136 int err; 1138 long err;
1137 struct v4l2_format *fmt2 = NULL; 1139 struct v4l2_format *fmt2 = NULL;
1138 1140
1139 if (VIDEO_PALETTE_RAW != fmt->sample_format) { 1141 if (VIDEO_PALETTE_RAW != fmt->sample_format) {
@@ -1157,7 +1159,7 @@ static noinline int v4l1_compat_set_vbi_format(
1157 fmt2->fmt.vbi.flags = fmt->flags; 1159 fmt2->fmt.vbi.flags = fmt->flags;
1158 err = drv(file, VIDIOC_TRY_FMT, fmt2); 1160 err = drv(file, VIDIOC_TRY_FMT, fmt2);
1159 if (err < 0) { 1161 if (err < 0) {
1160 dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err); 1162 dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %ld\n", err);
1161 goto done; 1163 goto done;
1162 } 1164 }
1163 1165
@@ -1174,7 +1176,7 @@ static noinline int v4l1_compat_set_vbi_format(
1174 } 1176 }
1175 err = drv(file, VIDIOC_S_FMT, fmt2); 1177 err = drv(file, VIDIOC_S_FMT, fmt2);
1176 if (err < 0) 1178 if (err < 0)
1177 dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err); 1179 dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %ld\n", err);
1178done: 1180done:
1179 kfree(fmt2); 1181 kfree(fmt2);
1180 return err; 1182 return err;
@@ -1183,13 +1185,13 @@ done:
1183/* 1185/*
1184 * This function is exported. 1186 * This function is exported.
1185 */ 1187 */
1186int 1188long
1187v4l_compat_translate_ioctl(struct file *file, 1189v4l_compat_translate_ioctl(struct file *file,
1188 int cmd, 1190 int cmd,
1189 void *arg, 1191 void *arg,
1190 v4l2_kioctl drv) 1192 v4l2_kioctl drv)
1191{ 1193{
1192 int err; 1194 long err;
1193 1195
1194 switch (cmd) { 1196 switch (cmd) {
1195 case VIDIOCGCAP: /* capability */ 1197 case VIDIOCGCAP: /* capability */
diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c
index b4f391431853..28861e4910f3 100644
--- a/drivers/media/video/v4l2-compat-ioctl32.c
+++ b/drivers/media/video/v4l2-compat-ioctl32.c
@@ -222,9 +222,9 @@ static int get_microcode32(struct video_code *kp, struct video_code32 __user *up
222 222
223#endif 223#endif
224 224
225static int native_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 225static long native_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
226{ 226{
227 int ret = -ENOIOCTLCMD; 227 long ret = -ENOIOCTLCMD;
228 228
229 if (file->f_op->unlocked_ioctl) 229 if (file->f_op->unlocked_ioctl)
230 ret = file->f_op->unlocked_ioctl(file, cmd, arg); 230 ret = file->f_op->unlocked_ioctl(file, cmd, arg);
@@ -705,7 +705,7 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
705#define VIDIOC_G_OUTPUT32 _IOR ('V', 46, s32) 705#define VIDIOC_G_OUTPUT32 _IOR ('V', 46, s32)
706#define VIDIOC_S_OUTPUT32 _IOWR('V', 47, s32) 706#define VIDIOC_S_OUTPUT32 _IOWR('V', 47, s32)
707 707
708static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 708static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
709{ 709{
710 union { 710 union {
711#ifdef CONFIG_VIDEO_V4L1_COMPAT 711#ifdef CONFIG_VIDEO_V4L1_COMPAT
@@ -726,7 +726,7 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
726 } karg; 726 } karg;
727 void __user *up = compat_ptr(arg); 727 void __user *up = compat_ptr(arg);
728 int compatible_arg = 1; 728 int compatible_arg = 1;
729 int err = 0; 729 long err = 0;
730 730
731 /* First, convert the command. */ 731 /* First, convert the command. */
732 switch (cmd) { 732 switch (cmd) {
@@ -939,7 +939,7 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
939 939
940long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg) 940long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
941{ 941{
942 int ret = -ENOIOCTLCMD; 942 long ret = -ENOIOCTLCMD;
943 943
944 if (!file->f_op->ioctl && !file->f_op->unlocked_ioctl) 944 if (!file->f_op->ioctl && !file->f_op->unlocked_ioctl)
945 return ret; 945 return ret;
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 3b834f42e97b..8f629ef5b9ec 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -392,14 +392,14 @@ video_fix_command(unsigned int cmd)
392/* 392/*
393 * Obsolete usercopy function - Should be removed soon 393 * Obsolete usercopy function - Should be removed soon
394 */ 394 */
395int 395long
396video_usercopy(struct file *file, unsigned int cmd, unsigned long arg, 396video_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
397 v4l2_kioctl func) 397 v4l2_kioctl func)
398{ 398{
399 char sbuf[128]; 399 char sbuf[128];
400 void *mbuf = NULL; 400 void *mbuf = NULL;
401 void *parg = NULL; 401 void *parg = NULL;
402 int err = -EINVAL; 402 long err = -EINVAL;
403 int is_ext_ctrl; 403 int is_ext_ctrl;
404 size_t ctrls_size = 0; 404 size_t ctrls_size = 0;
405 void __user *user_ptr = NULL; 405 void __user *user_ptr = NULL;
@@ -623,13 +623,13 @@ static int check_fmt(const struct v4l2_ioctl_ops *ops, enum v4l2_buf_type type)
623 return -EINVAL; 623 return -EINVAL;
624} 624}
625 625
626static int __video_do_ioctl(struct file *file, 626static long __video_do_ioctl(struct file *file,
627 unsigned int cmd, void *arg) 627 unsigned int cmd, void *arg)
628{ 628{
629 struct video_device *vfd = video_devdata(file); 629 struct video_device *vfd = video_devdata(file);
630 const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops; 630 const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
631 void *fh = file->private_data; 631 void *fh = file->private_data;
632 int ret = -EINVAL; 632 long ret = -EINVAL;
633 633
634 if ((vfd->debug & V4L2_DEBUG_IOCTL) && 634 if ((vfd->debug & V4L2_DEBUG_IOCTL) &&
635 !(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) { 635 !(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) {
@@ -1845,20 +1845,20 @@ static int __video_do_ioctl(struct file *file,
1845 if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { 1845 if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) {
1846 if (ret < 0) { 1846 if (ret < 0) {
1847 v4l_print_ioctl(vfd->name, cmd); 1847 v4l_print_ioctl(vfd->name, cmd);
1848 printk(KERN_CONT " error %d\n", ret); 1848 printk(KERN_CONT " error %ld\n", ret);
1849 } 1849 }
1850 } 1850 }
1851 1851
1852 return ret; 1852 return ret;
1853} 1853}
1854 1854
1855int video_ioctl2(struct file *file, 1855long video_ioctl2(struct file *file,
1856 unsigned int cmd, unsigned long arg) 1856 unsigned int cmd, unsigned long arg)
1857{ 1857{
1858 char sbuf[128]; 1858 char sbuf[128];
1859 void *mbuf = NULL; 1859 void *mbuf = NULL;
1860 void *parg = NULL; 1860 void *parg = NULL;
1861 int err = -EINVAL; 1861 long err = -EINVAL;
1862 int is_ext_ctrl; 1862 int is_ext_ctrl;
1863 size_t ctrls_size = 0; 1863 size_t ctrls_size = 0;
1864 void __user *user_ptr = NULL; 1864 void __user *user_ptr = NULL;
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c
index 63863fa8d65f..88bf845a3d56 100644
--- a/drivers/media/video/vino.c
+++ b/drivers/media/video/vino.c
@@ -4237,7 +4237,7 @@ error:
4237 return ret; 4237 return ret;
4238} 4238}
4239 4239
4240static int vino_do_ioctl(struct file *file, unsigned int cmd, void *arg) 4240static long vino_do_ioctl(struct file *file, unsigned int cmd, void *arg)
4241{ 4241{
4242 struct vino_channel_settings *vcs = video_drvdata(file); 4242 struct vino_channel_settings *vcs = video_drvdata(file);
4243 4243
@@ -4343,11 +4343,11 @@ static int vino_do_ioctl(struct file *file, unsigned int cmd, void *arg)
4343 return 0; 4343 return 0;
4344} 4344}
4345 4345
4346static int vino_ioctl(struct file *file, 4346static long vino_ioctl(struct file *file,
4347 unsigned int cmd, unsigned long arg) 4347 unsigned int cmd, unsigned long arg)
4348{ 4348{
4349 struct vino_channel_settings *vcs = video_drvdata(file); 4349 struct vino_channel_settings *vcs = video_drvdata(file);
4350 int ret; 4350 long ret;
4351 4351
4352 if (mutex_lock_interruptible(&vcs->mutex)) 4352 if (mutex_lock_interruptible(&vcs->mutex))
4353 return -EINTR; 4353 return -EINTR;
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
index 91500f57442a..038ff32b01b8 100644
--- a/drivers/media/video/w9966.c
+++ b/drivers/media/video/w9966.c
@@ -180,7 +180,7 @@ static int w9966_i2c_wbyte(struct w9966_dev* cam, int data);
180static int w9966_i2c_rbyte(struct w9966_dev* cam); 180static int w9966_i2c_rbyte(struct w9966_dev* cam);
181#endif 181#endif
182 182
183static int w9966_v4l_ioctl(struct file *file, 183static long w9966_v4l_ioctl(struct file *file,
184 unsigned int cmd, unsigned long arg); 184 unsigned int cmd, unsigned long arg);
185static ssize_t w9966_v4l_read(struct file *file, char __user *buf, 185static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
186 size_t count, loff_t *ppos); 186 size_t count, loff_t *ppos);
@@ -723,7 +723,7 @@ static int w9966_wReg_i2c(struct w9966_dev* cam, int reg, int data)
723 * Video4linux interfacing 723 * Video4linux interfacing
724 */ 724 */
725 725
726static int w9966_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg) 726static long w9966_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
727{ 727{
728 struct w9966_dev *cam = video_drvdata(file); 728 struct w9966_dev *cam = video_drvdata(file);
729 729
@@ -873,7 +873,7 @@ static int w9966_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
873 return 0; 873 return 0;
874} 874}
875 875
876static int w9966_v4l_ioctl(struct file *file, 876static long w9966_v4l_ioctl(struct file *file,
877 unsigned int cmd, unsigned long arg) 877 unsigned int cmd, unsigned long arg)
878{ 878{
879 return video_usercopy(file, cmd, arg, w9966_v4l_do_ioctl); 879 return video_usercopy(file, cmd, arg, w9966_v4l_do_ioctl);
diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c
index 159b4edd69e0..a3997b7d4366 100644
--- a/drivers/media/video/w9968cf.c
+++ b/drivers/media/video/w9968cf.c
@@ -403,9 +403,9 @@ static const struct v4l2_file_operations w9968cf_fops;
403static int w9968cf_open(struct file *); 403static int w9968cf_open(struct file *);
404static int w9968cf_release(struct file *); 404static int w9968cf_release(struct file *);
405static int w9968cf_mmap(struct file *, struct vm_area_struct *); 405static int w9968cf_mmap(struct file *, struct vm_area_struct *);
406static int w9968cf_ioctl(struct file *, unsigned, unsigned long); 406static long w9968cf_ioctl(struct file *, unsigned, unsigned long);
407static ssize_t w9968cf_read(struct file *, char __user *, size_t, loff_t *); 407static ssize_t w9968cf_read(struct file *, char __user *, size_t, loff_t *);
408static int w9968cf_v4l_ioctl(struct file *, unsigned int, 408static long w9968cf_v4l_ioctl(struct file *, unsigned int,
409 void __user *); 409 void __user *);
410 410
411/* USB-specific */ 411/* USB-specific */
@@ -2885,12 +2885,12 @@ static int w9968cf_mmap(struct file* filp, struct vm_area_struct *vma)
2885} 2885}
2886 2886
2887 2887
2888static int 2888static long
2889w9968cf_ioctl(struct file *filp, 2889w9968cf_ioctl(struct file *filp,
2890 unsigned int cmd, unsigned long arg) 2890 unsigned int cmd, unsigned long arg)
2891{ 2891{
2892 struct w9968cf_device* cam; 2892 struct w9968cf_device* cam;
2893 int err; 2893 long err;
2894 2894
2895 cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp)); 2895 cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp));
2896 2896
@@ -2916,7 +2916,7 @@ w9968cf_ioctl(struct file *filp,
2916} 2916}
2917 2917
2918 2918
2919static int w9968cf_v4l_ioctl(struct file *filp, 2919static long w9968cf_v4l_ioctl(struct file *filp,
2920 unsigned int cmd, void __user *arg) 2920 unsigned int cmd, void __user *arg)
2921{ 2921{
2922 struct w9968cf_device* cam; 2922 struct w9968cf_device* cam;
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c
index 46590f63f0eb..96971044fc78 100644
--- a/drivers/media/video/zc0301/zc0301_core.c
+++ b/drivers/media/video/zc0301/zc0301_core.c
@@ -1793,7 +1793,7 @@ zc0301_vidioc_s_parm(struct zc0301_device* cam, void __user * arg)
1793} 1793}
1794 1794
1795 1795
1796static int zc0301_ioctl_v4l2(struct file *filp, 1796static long zc0301_ioctl_v4l2(struct file *filp,
1797 unsigned int cmd, void __user *arg) 1797 unsigned int cmd, void __user *arg)
1798{ 1798{
1799 struct zc0301_device *cam = video_drvdata(filp); 1799 struct zc0301_device *cam = video_drvdata(filp);
@@ -1888,7 +1888,7 @@ static int zc0301_ioctl_v4l2(struct file *filp,
1888} 1888}
1889 1889
1890 1890
1891static int zc0301_ioctl(struct file *filp, 1891static long zc0301_ioctl(struct file *filp,
1892 unsigned int cmd, unsigned long arg) 1892 unsigned int cmd, unsigned long arg)
1893{ 1893{
1894 struct zc0301_device *cam = video_drvdata(filp); 1894 struct zc0301_device *cam = video_drvdata(filp);
diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c
index ce4a5e5f9d25..b58b9dda715c 100644
--- a/drivers/media/video/zoran/zoran_driver.c
+++ b/drivers/media/video/zoran/zoran_driver.c
@@ -1938,7 +1938,7 @@ zoran_set_input (struct zoran *zr,
1938 * ioctl routine 1938 * ioctl routine
1939 */ 1939 */
1940 1940
1941static int zoran_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1941static long zoran_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1942{ 1942{
1943 struct zoran_fh *fh = file->private_data; 1943 struct zoran_fh *fh = file->private_data;
1944 struct zoran *zr = fh->zr; 1944 struct zoran *zr = fh->zr;
@@ -4189,7 +4189,7 @@ static int zoran_do_ioctl(struct file *file, unsigned int cmd, void *arg)
4189} 4189}
4190 4190
4191 4191
4192static int 4192static long
4193zoran_ioctl(struct file *file, 4193zoran_ioctl(struct file *file,
4194 unsigned int cmd, 4194 unsigned int cmd,
4195 unsigned long arg) 4195 unsigned long arg)