On Tuesday 08 April 2008 11:50, ds ds wrote:
> 
> --- Laurent Pinchart <[EMAIL PROTECTED]> a
> écrit :
> 
> > Hi,
> > 
> > > It seems to compile ok ! 
> > > just a warning on usb_to_input_id :
> > > In function 'uvc_input_init':
> > > uvc_status.c:47: warning: implicit declaration of
> > > function 'usb_to_input_id'
> > > Warning: "usb_to_input_id"
> > > [/mnt/sda2/temp/uvc1/trunk/uvcvideo.ko] undefined!
> > > 
> > > The uvcvideo.ko is made. I still have no image,
> > but it
> > > must be my fault now. I continue.
> > 
> > Here's an updated patch. Could you please try it ?
> > 
> > Best regards,
> > 
> > Laurent Pinchart
> > > Index: uvc_status.c
> >
> ===================================================================
> > --- uvc_status.c    (revision 199)
> > +++ uvc_status.c    (working copy)
> > @@ -14,7 +14,11 @@
> >  #include <linux/kernel.h>
> >  #include <linux/input.h>
> >  #include <linux/usb.h>
> > +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
> > +#include <linux/usb_input.h>
> > +#else
> >  #include <linux/usb/input.h>
> > +#endif
> >  
> >  #include "uvcvideo.h"
> >  
> > @@ -43,7 +47,11 @@
> >     input->name = dev->name;
> >     input->phys = phys;
> >     usb_to_input_id(udev, &input->id);
> > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
> >     input->dev.parent = &dev->intf->dev;
> > +#else
> > +   input->cdev.dev = &dev->intf->dev;
> > +#endif
> >  
> >     set_bit(EV_KEY, input->evbit);
> >     set_bit(BTN_0, input->keybit);
> > 
> 
> There is a problem : it compile if I don't use the 2
> macros (that is, put the lines you gave directly) :
> uvc_status.c:18:5: warning: "LINUX_VERSION_CODE" is
> not defined
> uvc_status.c:18:26: warning: "KERNEL_VERSION" is not
> defined
> then compilation fails of course.
> Are they supposed to be known in bash ?
> echo $KERNEL_VERSION
> -> gives nothing
> I use Mandriva 2007.0

My bad. Here's an updated patch.

Best regards,

Laurent Pinchart
Index: uvc_status.c
===================================================================
--- uvc_status.c	(revision 199)
+++ uvc_status.c	(working copy)
@@ -12,9 +12,14 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/version.h>
 #include <linux/input.h>
 #include <linux/usb.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#include <linux/usb_input.h>
+#else
 #include <linux/usb/input.h>
+#endif
 
 #include "uvcvideo.h"
 
@@ -43,7 +48,11 @@
 	input->name = dev->name;
 	input->phys = phys;
 	usb_to_input_id(udev, &input->id);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
 	input->dev.parent = &dev->intf->dev;
+#else
+	input->cdev.dev = &dev->intf->dev;
+#endif
 
 	set_bit(EV_KEY, input->evbit);
 	set_bit(BTN_0, input->keybit);
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to