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 From 792ee989bae4e2a54629b2b819619163297648ee Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Thu, 14 Feb 2008 00:13:36 -0200 Subject: radio-si470x: Add kernel validation to work queue From: Douglas Schilling Landgraf Added kernel validation to support work_struct/delayed_work. (kernel < 2.6.20) Signed-off-by: Douglas Schilling Landgraf --- linux/drivers/media/radio/radio-si470x.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux') diff --git a/linux/drivers/media/radio/radio-si470x.c b/linux/drivers/media/radio/radio-si470x.c index d7fe70a00..e999b2fc3 100644 --- a/linux/drivers/media/radio/radio-si470x.c +++ b/linux/drivers/media/radio/radio-si470x.c @@ -432,7 +432,12 @@ struct si470x_device { unsigned short registers[RADIO_REGISTER_NUM]; /* RDS receive buffer */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) + struct work_struct work; +#else struct delayed_work work; +#endif + wait_queue_head_t read_queue; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) struct mutex lock; /* buffer locking */ -- cgit v1.2.3