[linux-dvb] [PATCH] Make v4l-dvb compile under kernels < 2.6.16

Trent Piepho xyzzy at speakeasy.org
Sun Apr 9 09:17:11 CEST 2006


The new drivers added to Hg don't all compile with kernels older than 2.6.16,
mostly do to the mutex.h stuff.  This patch will get them all to compile
cleanly.  Of course I don't have the hardware to test that all the drivers
actually WORK with older kernels, but they will compile.  Nothing should
change for kernels >= 2.6.16.

BTW, this patch would have been about half the work if compat.h would just:
#define mutex semaphore
for pre-mutex kernels.  As long as no one tries to export a variable or
function named mutex, and no one does, it's not going to mess anything up.
-------------- next part --------------
# HG changeset patch
# User Trent Piepho <xyzzy at speakeasy.org>
# Node ID 464e5213894386ce2a818dddfdfd97dfa21802ff
# Parent  68c189a0c277735b1df8431e0ceb42a785af2138
Make new drivers compile with older kernels

From: Trent Piepho <xyzzy at speakeasy.org>

Lots of drivers wouldn't compile with kernels < 2.6.16 because of the
semaphore -> mutex rename.  Also a small i2c bit for kernels < 2.6.13.

Signed-off-by: Trent Piepho <xyzzy at speakeasy.org>

diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/radio/miropcm20-rds-core.c
--- a/linux/drivers/media/radio/miropcm20-rds-core.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/radio/miropcm20-rds-core.c	Sun Apr  9 00:03:50 2006 -0700
@@ -18,7 +18,10 @@
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include "compat.h"
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 #include <asm/io.h>
 #include "../../../sound/oss/aci.h"
@@ -26,7 +29,11 @@
 
 #define DEBUG 0
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 static struct mutex aci_rds_mutex;
+#else
+static struct semaphore aci_rds_mutex;
+#endif
 
 #define RDS_DATASHIFT          2   /* Bit 2 */
 #define RDS_DATAMASK        (1 << RDS_DATASHIFT)
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/radio/radio-aimslab.c
--- a/linux/drivers/media/radio/radio-aimslab.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/radio/radio-aimslab.c	Sun Apr  9 00:03:50 2006 -0700
@@ -44,7 +44,11 @@
 
 static int io = CONFIG_RADIO_RTRACK_PORT;
 static int radio_nr = -1;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 static struct mutex lock;
+#else
+static struct semaphore lock;
+#endif
 
 struct rt_device
 {
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/radio/radio-aztech.c
--- a/linux/drivers/media/radio/radio-aztech.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/radio/radio-aztech.c	Sun Apr  9 00:03:50 2006 -0700
@@ -43,7 +43,11 @@ static int io = CONFIG_RADIO_AZTECH_PORT
 static int io = CONFIG_RADIO_AZTECH_PORT;
 static int radio_nr = -1;
 static int radio_wait_time = 1000;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 static struct mutex lock;
+#else
+static struct semaphore lock;
+#endif
 
 struct az_device
 {
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/radio/radio-maestro.c
--- a/linux/drivers/media/radio/radio-maestro.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/radio/radio-maestro.c	Sun Apr  9 00:03:50 2006 -0700
@@ -23,10 +23,12 @@
 #include <linux/sched.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
-#include <linux/mutex.h>
 #include <linux/pci.h>
 #include "compat.h"
 #include <linux/videodev.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
+#include <linux/mutex.h>
+#endif
 
 
 #define DRIVER_VERSION	"0.05"
@@ -106,7 +108,11 @@ struct radio_device {
 		muted,	/* VIDEO_AUDIO_MUTE */
 		stereo,	/* VIDEO_TUNER_STEREO_ON */
 		tuned;	/* signal strength (0 or 0xffff) */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;
+#else
+	struct semaphore lock;
+#endif
 };
 
 static u32 radio_bits_get(struct radio_device *dev)
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/radio/radio-maxiradio.c
--- a/linux/drivers/media/radio/radio-maxiradio.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/radio/radio-maxiradio.c	Sun Apr  9 00:03:50 2006 -0700
@@ -37,10 +37,12 @@
 #include <linux/sched.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
+#include "compat.h"
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 #include <linux/pci.h>
-#include "compat.h"
 #include <linux/videodev.h>
 
 /* version 0.75      Sun Feb  4 22:51:27 EET 2001 */
@@ -103,7 +105,11 @@ static struct radio_device
 
 	unsigned long freq;
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;
+#else
+	struct semaphore lock;
+#endif
 } radio_unit = {0, 0, 0, 0, };
 
 
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/radio/radio-sf16fmi.c
--- a/linux/drivers/media/radio/radio-sf16fmi.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/radio/radio-sf16fmi.c	Sun Apr  9 00:03:50 2006 -0700
@@ -25,7 +25,13 @@
 #include <linux/isapnp.h>
 #include <asm/io.h>		/* outb, outb_p			*/
 #include <asm/uaccess.h>	/* copy to/from user		*/
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+
+static struct mutex lock;
+#else
+static struct semaphore lock;
+#endif
 
 struct fmi_device
 {
@@ -38,7 +44,6 @@ static int io = -1;
 static int io = -1;
 static int radio_nr = -1;
 static struct pnp_dev *dev = NULL;
-static struct mutex lock;
 
 /* freq is in 1/16 kHz to internal number, hw precision is 50 kHz */
 /* It is only useful to give freq in intervall of 800 (=0.05Mhz),
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/radio/radio-sf16fmr2.c
--- a/linux/drivers/media/radio/radio-sf16fmr2.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/radio/radio-sf16fmr2.c	Sun Apr  9 00:03:50 2006 -0700
@@ -20,9 +20,13 @@
 #include <asm/uaccess.h>	/* copy to/from user		*/
 #include "compat.h"
 #include <linux/videodev.h>	/* kernel radio structs		*/
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
 
 static struct mutex lock;
+#else
+static struct semaphore lock;
+#endif
 
 #undef DEBUG
 //#define DEBUG 1
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/radio/radio-typhoon.c
--- a/linux/drivers/media/radio/radio-typhoon.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/radio/radio-typhoon.c	Sun Apr  9 00:03:50 2006 -0700
@@ -60,7 +60,11 @@ struct typhoon_device {
 	int muted;
 	unsigned long curfreq;
 	unsigned long mutefreq;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;
+#else
+	struct semaphore lock;
+#endif
 };
 
 static void typhoon_setvol_generic(struct typhoon_device *dev, int vol);
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/radio/radio-zoltrix.c
--- a/linux/drivers/media/radio/radio-zoltrix.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/radio/radio-zoltrix.c	Sun Apr  9 00:03:50 2006 -0700
@@ -49,7 +49,11 @@ struct zol_device {
 	unsigned long curfreq;
 	int muted;
 	unsigned int stereo;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;
+#else
+	struct semaphore lock;
+#endif
 };
 
 static int zol_setvol(struct zol_device *dev, int vol)
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/bw-qcam.c
--- a/linux/drivers/media/video/bw-qcam.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/bw-qcam.c	Sun Apr  9 00:03:50 2006 -0700
@@ -74,7 +74,9 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <linux/sched.h>
 #include "compat.h"
 #include <linux/videodev.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 #include <asm/uaccess.h>
 
 #include "bw-qcam.h"
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/bw-qcam.h
--- a/linux/drivers/media/video/bw-qcam.h	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/bw-qcam.h	Sun Apr  9 00:03:50 2006 -0700
@@ -55,7 +55,11 @@ struct qcam_device {
 	struct video_device vdev;
 	struct pardevice *pdev;
 	struct parport *pport;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;
+#else
+	struct semaphore lock;
+#endif
 	int width, height;
 	int bpp;
 	int mode;
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/c-qcam.c
--- a/linux/drivers/media/video/c-qcam.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/c-qcam.c	Sun Apr  9 00:03:50 2006 -0700
@@ -35,7 +35,9 @@
 #include <linux/sched.h>
 #include "compat.h"
 #include <linux/videodev.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 #include <asm/uaccess.h>
 
@@ -49,7 +51,11 @@ struct qcam_device {
 	int contrast, brightness, whitebal;
 	int top, left;
 	unsigned int bidirectional;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;
+#else
+	struct semaphore lock;
+#endif
 };
 
 /* cameras maximum */
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/cpia.c
--- a/linux/drivers/media/video/cpia.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/cpia.c	Sun Apr  9 00:03:50 2006 -0700
@@ -39,7 +39,10 @@
 #include <linux/pagemap.h>
 #include <linux/delay.h>
 #include <asm/io.h>
+#include "compat.h"
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 #ifdef CONFIG_KMOD
 #include <linux/kmod.h>
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/cpia.h
--- a/linux/drivers/media/video/cpia.h	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/cpia.h	Sun Apr  9 00:03:50 2006 -0700
@@ -48,7 +48,9 @@
 #include <linux/videodev.h>
 #include <linux/list.h>
 #include <linux/smp_lock.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 struct cpia_camera_ops
 {
@@ -248,7 +250,11 @@ struct cam_data {
 struct cam_data {
 	struct list_head cam_data_list;
 
-	struct mutex busy_lock;     /* guard against SMP multithreading */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
+	struct mutex busy_lock;		/* guard against SMP multithreading */
+#else
+	struct semaphore busy_lock;	/* guard against SMP multithreading */
+#endif
 	struct cpia_camera_ops *ops;	/* lowlevel driver operations */
 	void *lowlevel_data;		/* private data for lowlevel driver */
 	u8 *raw_image;			/* buffer for raw image data */
@@ -263,7 +269,11 @@ struct cam_data {
 	u8 mainsFreq;			/* for flicker control */
 
 				/* proc interface */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex param_lock;	/* params lock for this camera */
+#else
+	struct semaphore param_lock;	/* params lock for this camera */
+#endif
 	struct cam_params params;	/* camera settings */
 	struct proc_dir_entry *proc_entry;	/* /proc/cpia/videoX */
 
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/dabusb.c
--- a/linux/drivers/media/video/dabusb.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/dabusb.c	Sun Apr  9 00:03:50 2006 -0700
@@ -38,7 +38,10 @@
 #include <linux/delay.h>
 #include <linux/usb.h>
 #include <linux/smp_lock.h>
+#include "compat.h"
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 #include "dabusb.h"
 #include "dabfirmware.h"
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/dabusb.h
--- a/linux/drivers/media/video/dabusb.h	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/dabusb.h	Sun Apr  9 00:03:50 2006 -0700
@@ -18,7 +18,11 @@ typedef enum { _stopped=0, _started } dr
 
 typedef struct
 {
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex mutex;
+#else
+	struct semaphore mutex;
+#endif
 	struct usb_device *usbdev;
 	wait_queue_head_t wait;
 	wait_queue_head_t remove_ok;
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/meye.h
--- a/linux/drivers/media/video/meye.h	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/meye.h	Sun Apr  9 00:03:50 2006 -0700
@@ -260,7 +260,9 @@
 
 /* private API definitions */
 #include <linux/meye.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 
 /* Enable jpg software correction */
@@ -303,7 +305,11 @@ struct meye {
 					/* list of buffers */
 	struct meye_grab_buffer grab_buffer[MEYE_MAX_BUFNBRS];
 	int vma_use_count[MEYE_MAX_BUFNBRS]; /* mmap count */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;		/* mutex for open/mmap... */
+#else
+	struct semaphore lock;		/* mutex for open/mmap... */
+#endif
 	struct kfifo *grabq;		/* queue for buffers to be grabbed */
 	spinlock_t grabq_lock;		/* lock protecting the queue */
 	struct kfifo *doneq;		/* queue for grabbed buffers */
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/ov511.h
--- a/linux/drivers/media/video/ov511.h	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/ov511.h	Sun Apr  9 00:03:50 2006 -0700
@@ -6,7 +6,12 @@
 #include <linux/videodev.h>
 #include <linux/smp_lock.h>
 #include <linux/usb.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#else
+/* Having a version check for each mutex defined is annoying */
+#define 	mutex	semaphore
+#endif
 
 #define OV511_DEBUG	/* Turn on debug messages */
 
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/pms.c
--- a/linux/drivers/media/video/pms.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/pms.c	Sun Apr  9 00:03:50 2006 -0700
@@ -31,7 +31,9 @@
 #include <linux/sched.h>
 #include "compat.h"
 #include <linux/videodev.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 #include <asm/uaccess.h>
 
@@ -47,7 +49,11 @@ struct pms_device
 	struct video_picture picture;
 	int height;
 	int width;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;
+#else
+	struct semaphore lock;
+#endif
 };
 
 struct i2c_info
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/saa5246a.c
--- a/linux/drivers/media/video/saa5246a.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/saa5246a.c	Sun Apr  9 00:03:50 2006 -0700
@@ -47,7 +47,9 @@
 #include <linux/videotext.h>
 #include "compat.h"
 #include <linux/videodev.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 #include "saa5246a.h"
 
@@ -60,13 +62,20 @@ struct saa5246a_device
 	u8     pgbuf[NUM_DAUS][VTX_VIRTUALSIZE];
 	int    is_searching[NUM_DAUS];
 	struct i2c_client *client;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;
+#else
+	struct semaphore lock;
+#endif
 };
 
 static struct video_device saa_template;	/* Declared near bottom */
 
 /* Addresses to scan */
 static unsigned short normal_i2c[]	 = { I2C_ADDRESS, I2C_CLIENT_END };
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
+static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
+#endif
 I2C_CLIENT_INSMOD;
 
 static struct i2c_client client_template;
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/saa5249.c
--- a/linux/drivers/media/video/saa5249.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/saa5249.c	Sun Apr  9 00:03:50 2006 -0700
@@ -57,7 +57,9 @@
 #include <linux/videotext.h>
 #include "compat.h"
 #include <linux/videodev.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 
 #include <asm/io.h>
@@ -108,7 +110,11 @@ struct saa5249_device
 	int disp_mode;
 	int virtual_mode;
 	struct i2c_client *client;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;
+#else
+	struct semaphore lock;
+#endif
 };
 
 
@@ -135,6 +141,9 @@ static struct video_device saa_template;
 
 /* Addresses to scan */
 static unsigned short normal_i2c[] = {34>>1,I2C_CLIENT_END};
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
+static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
+#endif
 I2C_CLIENT_INSMOD;
 
 static struct i2c_client client_template;
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/se401.h
--- a/linux/drivers/media/video/se401.h	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/se401.h	Sun Apr  9 00:03:50 2006 -0700
@@ -6,7 +6,9 @@
 #include "compat.h"
 #include <linux/videodev.h>
 #include <linux/smp_lock.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 #define se401_DEBUG	/* Turn on debug messages */
 
@@ -191,7 +193,11 @@ struct usb_se401 {
 	int maxframesize;
 	int cframesize;		/* current framesize */
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;
+#else
+	struct semaphore lock;
+#endif
 	int user;		/* user count for exclusive use */
 	int removed;		/* device disconnected */
 
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/stv680.c
--- a/linux/drivers/media/video/stv680.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/stv680.c	Sun Apr  9 00:03:50 2006 -0700
@@ -68,7 +68,9 @@
 #include "compat.h"
 #include <linux/videodev.h>
 #include <linux/usb.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 #include "stv680.h"
 
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/stv680.h
--- a/linux/drivers/media/video/stv680.h	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/stv680.h	Sun Apr  9 00:03:50 2006 -0700
@@ -118,7 +118,11 @@ struct usb_stv {
 	int origGain;
 	int origMode;		/* original camera mode */
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex lock;	/* to lock the structure */
+#else
+	struct semaphore lock;	/* to lock the structure */
+#endif
 	int user;		/* user count for exclusive use */
 	int removed;		/* device disconnected */
 	int streaming;		/* Are we streaming video? */
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/w9968cf.h
--- a/linux/drivers/media/video/w9968cf.h	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/w9968cf.h	Sun Apr  9 00:03:50 2006 -0700
@@ -33,7 +33,12 @@
 #include <linux/param.h>
 #include <linux/types.h>
 #include <linux/rwsem.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#else
+/* Having a version check for each mutex defined is annoying */
+#define 	mutex	semaphore
+#endif
 
 #include <media/ovcamchip.h>
 
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/zoran.h
--- a/linux/drivers/media/video/zoran.h	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/zoran.h	Sun Apr  9 00:03:50 2006 -0700
@@ -395,7 +395,11 @@ struct zoran {
 	struct videocodec *codec;	/* video codec */
 	struct videocodec *vfe;	/* video front end */
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 	struct mutex resource_lock;	/* prevent evil stuff */
+#else
+	struct semaphore resource_lock;	/* prevent evil stuff */
+#endif
 
 	u8 initialized;		/* flag if zoran has been correctly initalized */
 	int user;		/* number of current users */
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/zoran_card.c
--- a/linux/drivers/media/video/zoran_card.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/zoran_card.c	Sun Apr  9 00:03:50 2006 -0700
@@ -48,7 +48,9 @@
 #include <linux/interrupt.h>
 #include <linux/video_decoder.h>
 #include <linux/video_encoder.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 
 #include <asm/io.h>
 
diff -r 68c189a0c277 -r 464e52138943 linux/drivers/media/video/zoran_driver.c
--- a/linux/drivers/media/video/zoran_driver.c	Sat Apr  8 23:22:47 2006 -0700
+++ b/linux/drivers/media/video/zoran_driver.c	Sun Apr  9 00:03:50 2006 -0700
@@ -81,7 +81,10 @@
 
 #include <linux/video_decoder.h>
 #include <linux/video_encoder.h>
+#include "compat.h"
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
 #include <linux/mutex.h>
+#endif
 #include "zoran.h"
 #include "zoran_device.h"
 #include "zoran_card.h"


More information about the linux-dvb mailing list