From 14709eca1644316f1fb628e14525e75dac44c591 Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Wed, 13 Feb 2008 23:51:26 -0200 Subject: radio-si470x: Add kernel validation to mutex From: Douglas Schilling Landgraf Added kernel validation to support mutex/semaphore. (kernel < 2.6.16) Signed-off-by: Douglas Schilling Landgraf --- linux/drivers/media/radio/radio-si470x.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'linux') diff --git a/linux/drivers/media/radio/radio-si470x.c b/linux/drivers/media/radio/radio-si470x.c index 772c3a126..d7fe70a00 100644 --- a/linux/drivers/media/radio/radio-si470x.c +++ b/linux/drivers/media/radio/radio-si470x.c @@ -114,7 +114,9 @@ #include #include "compat.h" #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) #include +#endif #include #include #include @@ -432,7 +434,11 @@ struct si470x_device { /* RDS receive buffer */ struct delayed_work work; wait_queue_head_t read_queue; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) struct mutex lock; /* buffer locking */ +#else + struct semaphore lock; /* buffer locking */ +#endif unsigned char *buffer; /* size is always multiple of three */ unsigned int buf_size; unsigned int rd_index; -- cgit v1.2.3