From 04f6a576c701b57b6e63d7d896d1910f2358ca9d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 9 Apr 2006 18:48:04 -0300 Subject: Make new drivers compile with older kernels From: Trent Piepho 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 Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cpia.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'linux/drivers/media/video/cpia.h') diff --git a/linux/drivers/media/video/cpia.h b/linux/drivers/media/video/cpia.h index 120b66388..b8539f244 100644 --- a/linux/drivers/media/video/cpia.h +++ b/linux/drivers/media/video/cpia.h @@ -48,7 +48,9 @@ #include #include #include +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) #include +#endif struct cpia_camera_ops { @@ -248,7 +250,11 @@ enum v4l_camstates { 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 */ -- cgit v1.2.3