summaryrefslogtreecommitdiff
path: root/v4l/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'v4l/compat.h')
-rw-r--r--v4l/compat.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index a4f66eee2..4b5f597fb 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -268,6 +268,10 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
# define input_allocate_device() kzalloc(sizeof(struct input_dev),GFP_KERNEL);
# define input_free_device(input_dev) kfree(input_dev)
+# ifdef _INPUT_H /* input.h must be included _before_ compat.h for this to work */
+ /* input_register_device() was changed to return an error code in 2.6.15 */
+# define input_register_device(x) (input_register_device(x), 0)
+# endif
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
@@ -288,6 +292,24 @@ schedule_timeout_interruptible(signed long timeout)
}
#endif
+/* New 4GB DMA zone was added in 2.6.15-rc2 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
+# define __GFP_DMA32 __GFP_DMA
+#endif
+
+/* setup_timer() helper added 10/31/05, 2.6.15-rc1 */
+/* Need linux/timer.h to be included for struct timer_list */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) && defined(_LINUX_TIMER_H)
+static inline void setup_timer(struct timer_list * timer,
+ void (*function)(unsigned long),
+ unsigned long data)
+{
+ timer->function = function;
+ timer->data = data;
+ init_timer(timer);
+}
+#endif
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
#define IRQF_SHARED SA_SHIRQ
#define IRQF_DISABLED SA_INTERRUPT