diff options
author | Douglas Schilling Landgraf <dougsland@gmail.com> | 2008-02-10 15:39:20 -0200 |
---|---|---|
committer | Douglas Schilling Landgraf <dougsland@gmail.com> | 2008-02-10 15:39:20 -0200 |
commit | 5af359015ddc9e36fc7a6620dbc0e8a1bdd08e93 (patch) | |
tree | 4c7a46043519f9a8bb8abcf5b7ae81a0f274334f | |
parent | 4ebd6086c983416fccbf09dbdc305e0aec07a56a (diff) | |
download | mediapointer-dvb-s2-5af359015ddc9e36fc7a6620dbc0e8a1bdd08e93.tar.gz mediapointer-dvb-s2-5af359015ddc9e36fc7a6620dbc0e8a1bdd08e93.tar.bz2 |
arv/planb/vino: Add kernel validation to mutex
From: Douglas Schilling Landgraf <dougsland@gmail.com>
Added kernel validation to support mutex/semaphore. (kernel < 2.6.16)
Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
-rw-r--r-- | linux/drivers/media/video/arv.c | 7 | ||||
-rw-r--r-- | linux/drivers/media/video/planb.c | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/planb.h | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/vino.c | 12 |
4 files changed, 26 insertions, 0 deletions
diff --git a/linux/drivers/media/video/arv.c b/linux/drivers/media/video/arv.c index 479ca4b46..0cd7f1d5e 100644 --- a/linux/drivers/media/video/arv.c +++ b/linux/drivers/media/video/arv.c @@ -30,7 +30,10 @@ #include "compat.h" #include <linux/videodev.h> #include <media/v4l2-common.h> + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) #include <linux/mutex.h> +#endif #include <asm/uaccess.h> #include <asm/m32r.h> @@ -116,7 +119,11 @@ struct ar_device { int width, height; int frame_bytes, line_bytes; wait_queue_head_t wait; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) struct mutex lock; +#else + struct semaphore lock; +#endif }; static int video_nr = -1; /* video device number (first free) */ diff --git a/linux/drivers/media/video/planb.c b/linux/drivers/media/video/planb.c index 358dc2996..e9860c883 100644 --- a/linux/drivers/media/video/planb.c +++ b/linux/drivers/media/video/planb.c @@ -50,7 +50,10 @@ #include <asm/pgtable.h> #include <asm/page.h> #include <asm/irq.h> + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) #include <linux/mutex.h> +#endif #include "planb.h" #include "saa7196.h" diff --git a/linux/drivers/media/video/planb.h b/linux/drivers/media/video/planb.h index e21b5735c..944e4960a 100644 --- a/linux/drivers/media/video/planb.h +++ b/linux/drivers/media/video/planb.h @@ -174,7 +174,11 @@ struct planb { int user; unsigned int tab_size; int maxlines; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) struct mutex lock; +#else + struct semaphore lock; +#endif unsigned int irq; /* interrupt number */ volatile unsigned int intr_mask; struct pci_dev *dev; /* Our PCI device */ diff --git a/linux/drivers/media/video/vino.c b/linux/drivers/media/video/vino.c index 01a4b9d3e..b867e7e8c 100644 --- a/linux/drivers/media/video/vino.c +++ b/linux/drivers/media/video/vino.c @@ -41,7 +41,10 @@ #include <linux/videodev.h> #include <media/v4l2-common.h> #include <linux/video_decoder.h> + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) #include <linux/mutex.h> +#endif #include <asm/paccess.h> #include <asm/io.h> @@ -245,7 +248,11 @@ struct vino_framebuffer_queue { struct vino_framebuffer *buffer[VINO_FRAMEBUFFER_COUNT_MAX]; spinlock_t queue_lock; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) struct mutex queue_mutex; +#else + struct semaphore queue_mutex; +#endif wait_queue_head_t frame_wait_queue; }; @@ -283,7 +290,12 @@ struct vino_channel_settings { /* the driver is currently processing the queue */ int capturing; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) struct mutex mutex; +#else + struct semaphore mutex; +#endif + spinlock_t capture_lock; unsigned int users; |