]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (9331): Remove unused inode parameter from video_ioctl2
authorMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 21 Oct 2008 14:58:39 +0000 (11:58 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 21 Oct 2008 16:31:49 +0000 (14:31 -0200)
inode is never used on video_ioctl2. Remove it and rename the function to
__video_ioctl2. This allows its usage directly as a callback at
fops.unlocked_ioctl.

Since we still need a callback with inode to be used with fops.ioctl,
this patch adds video_ioctl2() that is just a call to __video_ioctl2().

Also, this patch adds some comments about video_ioctl2 and __video_ioctl2
usage at v4l2-ioctl.h.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/ivtv/ivtv-ioctl.c
drivers/media/video/v4l2-ioctl.c
include/media/v4l2-ioctl.h

index 09a75abcb478e1e5a41ae2a9082ef58497171a09..4bae38d21ef6099cd24cc21edfc3d7d3a4a56f44 100644 (file)
@@ -1830,7 +1830,7 @@ static long ivtv_serialized_ioctl(struct ivtv *itv, struct file *filp,
 
        if (ivtv_debug & IVTV_DBGFLG_IOCTL)
                vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
-       ret = video_ioctl2_unlocked(filp, cmd, arg);
+       ret = __video_ioctl2(filp, cmd, arg);
        vfd->debug = 0;
        return ret;
 }
index 5b3e251b93961b335eb3efad881ede82cf8530c1..710e1a40c422b1f787ce55b677b39ae4f029acff 100644 (file)
@@ -1768,7 +1768,7 @@ static int __video_do_ioctl(struct file *file,
        return ret;
 }
 
-int video_ioctl2(struct inode *inode, struct file *file,
+int __video_ioctl2(struct file *file,
               unsigned int cmd, unsigned long arg)
 {
        char    sbuf[128];
@@ -1860,11 +1860,11 @@ out:
        kfree(mbuf);
        return err;
 }
-EXPORT_SYMBOL(video_ioctl2);
+EXPORT_SYMBOL(__video_ioctl2);
 
-long video_ioctl2_unlocked(struct file *file,
-                unsigned int cmd, unsigned long arg)
+int video_ioctl2(struct inode *inode, struct file *file,
+              unsigned int cmd, unsigned long arg)
 {
-       return video_ioctl2(file->f_path.dentry->d_inode, file, cmd, arg);
+       return __video_ioctl2(file, cmd, arg);
 }
-EXPORT_SYMBOL(video_ioctl2_unlocked);
+EXPORT_SYMBOL(video_ioctl2);
index 7a919433a4230881dab9661224be0b495e64c30b..e6ba25b3d7c8bd345b5c5c30732f2c4f78d59f5a 100644 (file)
@@ -284,15 +284,25 @@ int v4l_compat_translate_ioctl(struct file *file,
 extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
                                unsigned long arg);
 
-extern int video_ioctl2(struct inode *inode, struct file *file,
-                       unsigned int cmd, unsigned long arg);
-extern long video_ioctl2_unlocked(struct file *file,
-                       unsigned int cmd, unsigned long arg);
-
 /* Include support for obsoleted stuff */
 extern int video_usercopy(struct inode *inode, struct file *file,
                          unsigned int cmd, unsigned long arg,
                          int (*func)(struct inode *inode, struct file *file,
                                      unsigned int cmd, void *arg));
 
+/* Standard handlers for V4L ioctl's */
+
+/* This prototype is used on fops.unlocked_ioctl */
+extern int __video_ioctl2(struct file *file,
+                       unsigned int cmd, unsigned long arg);
+
+/* This prototype is used on fops.ioctl
+ * Since fops.ioctl enables Kernel Big Lock, it is preferred
+ * to use __video_ioctl2 instead.
+ * It should be noticed that there's no lock code inside
+ * video_ioctl2().
+ */
+extern int video_ioctl2(struct inode *inode, struct file *file,
+                       unsigned int cmd, unsigned long arg);
+
 #endif /* _V4L2_IOCTL_H */