Márton Németh wrote:
> The inode parameter of typedef v4l2_kioctl was removed at Linux 2.6.28.
> Then the return value of typedef v4l2_kioctl was changed from int to long in 
> 2.6.29-rc2 (or
> earlier, but not before 2.6.29-rc1).
> 
> Currently the functions em28xx_v4l2_ioctl() and em28xx_video_do_ioctl() should
> have the prototype of typedef v4l2_kioctl. The reason for this is the call of 
> video_usercopy()
> function which takes a function pointer for its last argument. This pointer 
> should have
> the type v4l2_kioctl.

I tested the patch with 2.6.27 and it seems that the #elsif cannot be used. 
Please find
attached the updated patch.

Regards,

        Márton Németh

diff -r fef4aba53836 em28xx-video.c
--- a/em28xx-video.c	Fri Jan 23 07:23:44 2009 +0100
+++ b/em28xx-video.c	Fri Jan 23 08:31:26 2009 +0100
@@ -1901,14 +1901,20 @@
 
 /*
  * em28xx_v4l2_ioctl()
- * Handle V4L2 ioctl. Has the prototype of v4l2_kioctl.
+ * Handle V4L2 ioctl. Has the prototype of v4l2_kioctl as defined in
+ * linux/include/media/v4l2-ioctl.h
  */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)
 static int em28xx_v4l2_ioctl(struct inode *inode, struct file *filp,
 			     unsigned int cmd, void *arg);
 #else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
 static int em28xx_v4l2_ioctl(struct file *filp,
 			     unsigned int cmd, void *arg);
+#else
+static long em28xx_v4l2_ioctl(struct file *filp,
+			     unsigned int cmd, void *arg);
+#endif
 #endif
 
 
@@ -2431,9 +2437,22 @@
  * This function is _not_ called directly, but from
  * em28xx_v4l2_ioctl. Userspace
  * copying is done already, arg is a kernel pointer.
- */
+ *
+ * This function have the prototype v4l2_kioctl as defined in
+ * linux/include/media/v4l2-ioctl.h
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)
 static int em28xx_video_do_ioctl(struct inode *inode, struct file *filp,
 				 unsigned int cmd, void *arg)
+#else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)
+static int em28xx_video_do_ioctl(struct file *filp,
+				 unsigned int cmd, void *arg)
+#else
+static long em28xx_video_do_ioctl(struct file *filp,
+				 unsigned int cmd, void *arg)
+#endif
+#endif
 {
 	struct em28xx_fh *fh = filp->private_data;
 	struct em28xx *dev = fh->dev;
@@ -2866,7 +2885,7 @@
 		return 0;
 	}
 	default:
-		return em28xx_do_ioctl(inode, filp, dev, cmd, arg,
+		return em28xx_do_ioctl(NULL, filp, dev, cmd, arg,
 				       em28xx_v4l2_ioctl);
 	}
 	return 0;
@@ -2876,14 +2895,20 @@
 
 /*
  * em28xx_v4l2_ioctl()
- * Handle V4L2 ioctl. Has the prototype of v4l2_kioctl.
+ * Handle V4L2 ioctl. Has the prototype of v4l2_kioctl as defined in
+ * linux/include/media/v4l2-ioctl.h
  */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)
 static int em28xx_v4l2_ioctl(struct inode *inode, struct file *filp,
 			     unsigned int cmd, void *arg)
 #else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
 static int em28xx_v4l2_ioctl(struct file *filp,
 			     unsigned int cmd, void *arg)
+#else
+static long em28xx_v4l2_ioctl(struct file *filp,
+			     unsigned int cmd, void *arg)
+#endif
 #endif
 {
 	int ret = 0;
_______________________________________________
Em28xx mailing list
Em28xx@mcentral.de
http://mcentral.de/mailman/listinfo/em28xx

Reply via email to