1 From 01dbc609534dc68b8890267b95c8a1efcd17437d Mon Sep 17 00:00:00 2001
3 Date: Mon, 23 May 2011 01:02:20 +0200
4 Subject: [PATCH] use mutex instead of BKL if kernel version is greater than
7 the BKL got removed with kernel version 2.6.39
8 and therefore we have to use a proper locking mechanism
10 af903x-fe.c | 12 +++++++++---
13 3 files changed, 14 insertions(+), 5 deletions(-)
15 diff --git a/af903x-fe.c b/af903x-fe.c
16 index 6f36a68..a1d1077 100644
20 #include <linux/sched.h>
21 -#include <linux/smp_lock.h>
22 #include <linux/list.h>
23 #include <linux/module.h>
24 #include <linux/version.h>
26 #define A333_FREQ_MIN 44250000
27 #define A333_FREQ_MAX 867250000
32 static int alwayslock; // default to 0
33 module_param(alwayslock, int, 0644);
34 @@ -678,7 +677,11 @@ static int af903x_monitor_thread_func(void *data)
35 deb_data("- Enter %s Function -\n",__FUNCTION__);
36 if( !state ) return -1;
38 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
43 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,61)
45 sigfillset(¤t->blocked);
46 @@ -689,8 +692,11 @@ static int af903x_monitor_thread_func(void *data)
48 siginitsetinv(¤t->blocked, sigmask(SIGKILL)|sigmask(SIGINT)|\
50 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
54 + mutex_unlock(&mutex);
56 while(!state->thread_should_stop && !signal_pending(current)) {
59 diff --git a/af903x.h b/af903x.h
60 index 203ff51..b2b35e3 100644
64 #include <linux/slab.h>
65 #include <linux/module.h>
66 #include <linux/kref.h>
67 +#include <linux/version.h>
68 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
69 #include <linux/smp_lock.h>
71 +#include <linux/mutex.h>
73 #include <linux/usb.h>
74 #include <asm/uaccess.h>
80 -#include <linux/version.h>
83 #define ENABLE_TEST_FUNCTION 0
84 diff --git a/usb2impl.c b/usb2impl.c
85 index a3a30f9..3cf8b64 100644
89 #include <linux/slab.h>
90 #include <linux/module.h>
91 #include <linux/kref.h>
92 -#include <linux/smp_lock.h>
93 #include <linux/usb.h>
94 #include <asm/uaccess.h>
95 #include <linux/device.h>