summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-01-30 18:25:46 -0800
committerTrent Piepho <xyzzy@speakeasy.org>2007-01-30 18:25:46 -0800
commitfca7ef71fcb220fb867d2f6d7e2e691adfa51906 (patch)
treee52871d1e273b53258c8c82969ebda47a9364c91 /v4l
parent0b945b64fba3381dfc97c66722fe76193f0008d3 (diff)
downloadmediapointer-dvb-s2-fca7ef71fcb220fb867d2f6d7e2e691adfa51906.tar.gz
mediapointer-dvb-s2-fca7ef71fcb220fb867d2f6d7e2e691adfa51906.tar.bz2
compat: Handle input_register_device() change and some others
From: Trent Piepho <xyzzy@speakeasy.org> input_register_device() was changed to return an error code instead of being void in 2.6.15. Handle it with a macro wrapper in config.h. For this to work, linux/input.h must be included before config.h. This required some trivial header re-ordering in budget-ci.c and ttusb_dec.c. In kernel 2.6.15-rc1 a helper function called setup_timer() was added to linux/timer.h. Add to compat.h, but require that linux/timer.h be included first to give the definition of struct timer_list. A new 4GB DMA zone, __GFP_DMA32, was added in 2.6.15-rc2. Alias it to __GFP_DMA on older kernels. Handle another 2.6.15 "input_dev->dev to input_dev->cdev.dev" change for some recently added code in cinergyT2.c. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'v4l')
-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