diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-08 01:17:00 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-08 01:17:00 +0200 |
commit | 1e35850ac2509c324478d38091880e60ab28795f (patch) | |
tree | ffb89f595c6bcea9189a5f090fad092c8aa7428e /v4l/compat.h | |
parent | 7ce87336c2f386ab6c35e985a5832d21b5cd7fab (diff) | |
download | mediapointer-dvb-s2-1e35850ac2509c324478d38091880e60ab28795f.tar.gz mediapointer-dvb-s2-1e35850ac2509c324478d38091880e60ab28795f.tar.bz2 |
v4l-dvb: remove support for kernels < 2.6.10
From: Hans Verkuil <hverkuil@xs4all.nl>
Phase 2 removes support for kernels < 2.6.10.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'v4l/compat.h')
-rw-r--r-- | v4l/compat.h | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/v4l/compat.h b/v4l/compat.h index 7abce35e0..ecfb51a2f 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -39,21 +39,10 @@ # define device_unregister(a) class_device_unregister(a) #endif -#if defined(I2C_ADAP_CLASS_TV_ANALOG) && !defined(I2C_CLASS_TV_ANALOG) -# define I2C_CLASS_TV_ANALOG I2C_ADAP_CLASS_TV_ANALOG -# define I2C_CLASS_TV_DIGITAL I2C_ADAP_CLASS_TV_DIGITAL -#endif - #ifndef __pure # define __pure __attribute__((pure)) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) -# define __user -# define __kernel -# define __iomem -#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) # define pm_message_t u32 # define pci_choose_state(pci_dev, state) (state) @@ -71,58 +60,6 @@ # define I2C_ALGO_BIT 0x010000 #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) -#define __le32 __u32 -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7) -static inline unsigned long msecs_to_jiffies(const unsigned int m) -{ -#if HZ <= 1000 && !(1000 % HZ) - return (m + (1000 / HZ) - 1) / (1000 / HZ); -#else -#if HZ > 1000 && !(HZ % 1000) - return m * (HZ / 1000); -#else - return (m * HZ + 999) / 1000; -#endif -#endif -} -static inline unsigned int jiffies_to_msecs(const unsigned long j) -{ -#if HZ <= 1000 && !(1000 % HZ) - return (1000 / HZ) * j; -#else -#if HZ > 1000 && !(HZ % 1000) - return (j + (HZ / 1000) - 1)/(HZ / 1000); -#else - return (j * 1000) / HZ; -#endif -#endif -} -static inline void msleep(unsigned int msecs) -{ - unsigned long timeout = msecs_to_jiffies(msecs); - while (timeout) { - set_current_state(TASK_UNINTERRUPTIBLE); - timeout = schedule_timeout(timeout); - } -} -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) -static inline unsigned long msleep_interruptible(unsigned int msecs) -{ - unsigned long timeout = msecs_to_jiffies(msecs); - - while (timeout) { - set_current_state(TASK_INTERRUPTIBLE); - timeout = schedule_timeout(timeout); - } - return jiffies_to_msecs(timeout); -} -#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) # define KEY_SEND 231 # define KEY_REPLY 232 @@ -131,48 +68,6 @@ static inline unsigned long msleep_interruptible(unsigned int msecs) # define KEY_DOCUMENTS 235 #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) -#include <linux/mm.h> -static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr) -{ - return page_to_pfn(vmalloc_to_page(vmalloc_addr)); -} - -static unsigned long kvirt_to_pa(unsigned long adr) -{ - unsigned long kva, ret; - - kva = (unsigned long) page_address(vmalloc_to_page((void *)adr)); - kva |= adr & (PAGE_SIZE-1); /* restore the offset */ - ret = __pa(kva); - return ret; -} - -#ifndef wait_event_timeout -#define wait_event_timeout(wq, condition, timeout) \ -({ \ - long __ret = timeout; \ - if (!(condition)) \ - do { \ - DEFINE_WAIT(__wait); \ - for (;;) { \ - prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ - if (condition) \ - break; \ - __ret = schedule_timeout(__ret); \ - if (!__ret) \ - break; \ - } \ - finish_wait(&wq, &__wait); \ - } while (0); \ - __ret; \ -}) -#endif - -#define remap_pfn_range remap_page_range - -#endif - /* vm_insert_page() was added in 2.6.15 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) && defined(_LINUX_MM_H) static inline int vm_insert_page(struct vm_area_struct *vma, @@ -183,19 +78,6 @@ static inline int vm_insert_page(struct vm_area_struct *vma, } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) -#ifndef kcalloc -#define kcalloc(n,size,flags) \ -({ \ - void * __ret = NULL; \ - __ret = kmalloc(n * size, flags); \ - if (__ret) \ - memset(__ret, 0, n * size); \ - __ret; \ -}) -#endif -#endif - /* try_to_freeze() lost its argument. Must appear after linux/sched.h */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) && defined(_LINUX_SCHED_H) # define try_to_freeze() try_to_freeze(PF_FREEZE) |