From df6112a72da3840ed73c44ba5bdc8f69228d4393 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Mon, 19 Feb 2007 19:27:58 -0800 Subject: compat: input_dev compat code for konicawc and quickcam_messenger From: Trent Piepho Adjust konicawc and quickcam_messenger to use backward compat code relating to changes in the input layer in 2.6.15. They should now work in 2.6.12. Signed-off-by: Trent Piepho --- linux/drivers/media/video/usbvideo/konicawc.c | 13 +++++++++---- linux/drivers/media/video/usbvideo/quickcam_messenger.c | 12 ++++++++---- linux/drivers/media/video/usbvideo/usbvideo.h | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/usbvideo/konicawc.c b/linux/drivers/media/video/usbvideo/konicawc.c index 5ab17aaab..8ca93f248 100644 --- a/linux/drivers/media/video/usbvideo/konicawc.c +++ b/linux/drivers/media/video/usbvideo/konicawc.c @@ -15,15 +15,16 @@ #include #include #include -#include "compat.h" -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) -#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18) +#include +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) #include #else -#include +#include #endif #include "usbvideo.h" +#include "compat.h" #define MAX_BRIGHTNESS 108 #define MAX_CONTRAST 108 @@ -242,7 +243,11 @@ static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev input_dev->name = "Konicawc snapshot button"; input_dev->phys = cam->input_physname; usb_to_input_id(dev, &input_dev->id); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) input_dev->cdev.dev = &dev->dev; +#else + input_dev->dev = &dev->dev; +#endif input_dev->evbit[0] = BIT(EV_KEY); input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0); diff --git a/linux/drivers/media/video/usbvideo/quickcam_messenger.c b/linux/drivers/media/video/usbvideo/quickcam_messenger.c index 614c821ed..849f94bab 100644 --- a/linux/drivers/media/video/usbvideo/quickcam_messenger.c +++ b/linux/drivers/media/video/usbvideo/quickcam_messenger.c @@ -33,15 +33,15 @@ #include #include #include -#include "compat.h" -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) -#include -#else +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18) #include +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) +#include #endif #include "usbvideo.h" #include "quickcam_messenger.h" +#include "compat.h" /* * Version Information @@ -105,7 +105,11 @@ static void qcm_register_input(struct qcm *cam, struct usb_device *dev) input_dev->name = "QCM button"; input_dev->phys = cam->input_physname; usb_to_input_id(dev, &input_dev->id); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) input_dev->cdev.dev = &dev->dev; +#else + input_dev->dev = &dev->dev; +#endif input_dev->evbit[0] = BIT(EV_KEY); input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0); diff --git a/linux/drivers/media/video/usbvideo/usbvideo.h b/linux/drivers/media/video/usbvideo/usbvideo.h index aaafce2b5..c1f892825 100644 --- a/linux/drivers/media/video/usbvideo/usbvideo.h +++ b/linux/drivers/media/video/usbvideo/usbvideo.h @@ -16,13 +16,13 @@ #ifndef usbvideo_h #define usbvideo_h -#include "compat.h" #include #include #include #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) #include #endif +#include "compat.h" /* Most helpful debugging aid */ #define assert(expr) ((void) ((expr) ? 0 : (err("assert failed at line %d",__LINE__)))) -- cgit v1.2.3