summaryrefslogtreecommitdiff
path: root/v4l/compat.h
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-07-08 00:19:19 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2008-07-08 00:19:19 +0200
commit7ce87336c2f386ab6c35e985a5832d21b5cd7fab (patch)
tree13562d693161dbaef976462e0f777fd49f4f8bf1 /v4l/compat.h
parent64a2df85368a26eafb15272ae2ba0fc556fbae21 (diff)
downloadmediapointer-dvb-s2-7ce87336c2f386ab6c35e985a5832d21b5cd7fab.tar.gz
mediapointer-dvb-s2-7ce87336c2f386ab6c35e985a5832d21b5cd7fab.tar.bz2
v4l-dvb: remove support for kernels < 2.6.0
From: Hans Verkuil <hverkuil@xs4all.nl> First phase of the backwards compatibility cleanup: stop supporting kernels older than 2.6.0. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'v4l/compat.h')
-rw-r--r--v4l/compat.h113
1 files changed, 2 insertions, 111 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 88afe3d83..7abce35e0 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -31,10 +31,6 @@
#define cancel_delayed_work_sync cancel_rearming_delayed_work
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
-# define minor(x) MINOR(x)
-#endif
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
# define DEVICE_ATTR(a,b,c,d) CLASS_DEVICE_ATTR(a,b,c,d)
# define device_create_file(a,b) class_device_create_file(a,b)
@@ -43,30 +39,6 @@
# define device_unregister(a) class_device_unregister(a)
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-# include <linux/moduleparam.h>
-# include <linux/delay.h>
-# define need_resched() (current->need_resched)
-# define work_struct tq_struct
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
-# define BUG_ON(condition) do { if ((condition)!=0) BUG(); } while(0)
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
-# define irqreturn_t void
-# define IRQ_RETVAL(foobar)
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71)
-# define strlcpy(dest,src,len) strncpy(dest,src,(len)-1)
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-# define iminor(inode) minor(inode->i_rdev)
-#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
@@ -89,26 +61,6 @@
# define assert_spin_locked(foobar)
#endif
-/* Since v4l-dvb now includes it's own copy of linux/i2c-id.h these
- are no longer necessary */
-/*
-#if !defined(I2C_ALGO_SAA7134)
-#define I2C_ALGO_SAA7134 I2C_HW_B_BT848
-#endif
-#if !defined(I2C_HW_B_CX2388x)
-# define I2C_HW_B_CX2388x I2C_HW_B_BT848
-#endif
-#if !defined(I2C_HW_SAA7134)
-# define I2C_HW_SAA7134 I2C_ALGO_SAA7134
-#endif
-#if !defined(I2C_HW_SAA7146)
-# define I2C_HW_SAA7146 I2C_ALGO_SAA7146
-#endif
-#if !defined(I2C_HW_B_EM2820)
-#define I2C_HW_B_EM2820 0x99
-#endif
-*/
-
#ifndef I2C_M_IGNORE_NAK
# define I2C_M_IGNORE_NAK 0x1000
#endif
@@ -123,7 +75,7 @@
#define __le32 __u32
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7))
+#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)
@@ -158,7 +110,7 @@ static inline void msleep(unsigned int msecs)
}
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
+#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);
@@ -171,52 +123,6 @@ static inline unsigned long msleep_interruptible(unsigned int msecs)
}
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-/* some keys from 2.6.x which are not (yet?) in 2.4.x */
-# define KEY_PLAY 207
-# define KEY_PRINT 210
-# define KEY_EMAIL 215
-# define KEY_SEARCH 217
-# define KEY_SELECT 0x161
-# define KEY_GOTO 0x162
-# define KEY_INFO 0x166
-# define KEY_CHANNEL 0x16b
-# define KEY_LANGUAGE 0x170
-# define KEY_SUBTITLE 0x172
-# define KEY_ZOOM 0x174
-# define KEY_MODE 0x175
-# define KEY_TV 0x179
-# define KEY_CD 0x17f
-# define KEY_TUNER 0x182
-# define KEY_TEXT 0x184
-# define KEY_DVD 0x185
-# define KEY_AUDIO 0x188
-# define KEY_VIDEO 0x189
-# define KEY_RED 0x18e
-# define KEY_GREEN 0x18f
-# define KEY_YELLOW 0x190
-# define KEY_BLUE 0x191
-# define KEY_CHANNELUP 0x192
-# define KEY_CHANNELDOWN 0x193
-# define KEY_RESTART 0x198
-# define KEY_SHUFFLE 0x19a
-# define KEY_NEXT 0x197
-# define KEY_RADIO 0x181
-# define KEY_PREVIOUS 0x19c
-# define KEY_MHP 0x16f
-# define KEY_EPG 0x16d
-# define KEY_FASTFORWARD 208
-# define KEY_LIST 0x18b
-# define KEY_LAST 0x195
-# define KEY_CLEAR 0x163
-# define KEY_AUX 0x186
-# define KEY_SCREEN 0x177
-# define KEY_PC 0x178
-# define KEY_MEDIA 226
-# define KEY_SLOW 0x199
-# define KEY_OK 0x160
-# define KEY_DIGITS 0x19d
-#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
# define KEY_SEND 231
# define KEY_REPLY 232
@@ -225,12 +131,6 @@ static inline unsigned long msleep_interruptible(unsigned int msecs)
# define KEY_DOCUMENTS 235
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
-#endif
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
#include <linux/mm.h>
static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr)
@@ -298,11 +198,7 @@ static inline int vm_insert_page(struct vm_area_struct *vma,
/* 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)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
# define try_to_freeze() try_to_freeze(PF_FREEZE)
-# else
-# define try_to_freeze() (0)
-# endif
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
@@ -317,11 +213,6 @@ static inline int vm_insert_page(struct vm_area_struct *vma,
#endif
#endif
-/* The class_device system didn't appear until 2.5.69 */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-#define class_device_create_file(a, b) (0)
-#endif
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
# define class_device_create(a, b, c, d, e, f, g, h) class_simple_device_add(a, c, d, e, f, g, h)
# define class_device_destroy(a, b) class_simple_device_remove(b)