updated on Sun Jan 15 16:02:00 UTC 2012
[aur-mirror.git] / avermedia_a867 / 2.6.39.patch
blob2f8860313c35efced17d112ac98ff7f4d5eb2522
1 From 01dbc609534dc68b8890267b95c8a1efcd17437d Mon Sep 17 00:00:00 2001
2 From: FLN <bp@9y.com>
3 Date: Mon, 23 May 2011 01:02:20 +0200
4 Subject: [PATCH] use mutex instead of BKL if kernel version is greater than
5 2.6.38
7 the BKL got removed with kernel version 2.6.39
8 and therefore we have to use a proper locking mechanism
9 ---
10 af903x-fe.c | 12 +++++++++---
11 af903x.h | 6 +++++-
12 usb2impl.c | 1 -
13 3 files changed, 14 insertions(+), 5 deletions(-)
15 diff --git a/af903x-fe.c b/af903x-fe.c
16 index 6f36a68..a1d1077 100644
17 --- a/af903x-fe.c
18 +++ b/af903x-fe.c
19 @@ -1,5 +1,4 @@
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>
25 @@ -11,7 +10,7 @@
26 #define A333_FREQ_MIN 44250000
27 #define A333_FREQ_MAX 867250000
30 +DEFINE_MUTEX(mutex);
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)
39 lock_kernel();
40 +#else
41 + mutex_lock(&mutex);
42 +#endif
43 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,61)
44 daemonize();
45 sigfillset(&current->blocked);
46 @@ -689,8 +692,11 @@ static int af903x_monitor_thread_func(void *data)
47 #endif
48 siginitsetinv(&current->blocked, sigmask(SIGKILL)|sigmask(SIGINT)|\
49 sigmask(SIGTERM));
50 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
51 unlock_kernel();
53 +#else
54 + mutex_unlock(&mutex);
55 +#endif
56 while(!state->thread_should_stop && !signal_pending(current)) {
58 DWORD dwError;
59 diff --git a/af903x.h b/af903x.h
60 index 203ff51..b2b35e3 100644
61 --- a/af903x.h
62 +++ b/af903x.h
63 @@ -9,7 +9,12 @@
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>
70 +#else
71 +#include <linux/mutex.h>
72 +#endif
73 #include <linux/usb.h>
74 #include <asm/uaccess.h>
75 #include <dvb-usb.h>
76 @@ -19,7 +24,6 @@
77 #include "firmware.h"
78 #include "type.h"
79 #include "Common.h"
80 -#include <linux/version.h>
81 #include "debug.h"
83 #define ENABLE_TEST_FUNCTION 0
84 diff --git a/usb2impl.c b/usb2impl.c
85 index a3a30f9..3cf8b64 100644
86 --- a/usb2impl.c
87 +++ b/usb2impl.c
88 @@ -10,7 +10,6 @@
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>
96 --
97 1.7.5.2