1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
diff -Nru em8300-cgmeiner-build/modules/em8300_alsa.c em8300-cgmeiner/modules/em8300_alsa.c
--- em8300-cgmeiner-build/modules/em8300_alsa.c 2011-06-11 15:17:24.530300168 +0200
+++ em8300-cgmeiner/modules/em8300_alsa.c 2011-06-11 15:53:53.142791260 +0200
@@ -487,7 +487,7 @@
memset(em8300_alsa, 0, sizeof(em8300_alsa_t));
- init_MUTEX(&em8300_alsa->lock);
+ sema_init(&em8300_alsa->lock,1);
em8300_alsa->em = em;
em8300_alsa->card = card;
diff -Nru em8300-cgmeiner-build/modules/em8300_fifo.c em8300-cgmeiner/modules/em8300_fifo.c
--- em8300-cgmeiner-build/modules/em8300_fifo.c 2011-06-11 15:17:24.540297986 +0200
+++ em8300-cgmeiner/modules/em8300_fifo.c 2011-06-11 15:53:53.142791260 +0200
@@ -116,7 +116,7 @@
}
}
- init_MUTEX(&f->lock);
+ sema_init(&f->lock,1);
f->valid = 1;
return 0;
diff -Nru em8300-cgmeiner-build/modules/em8300_main.c em8300-cgmeiner/modules/em8300_main.c
--- em8300-cgmeiner-build/modules/em8300_main.c 2011-06-11 15:17:24.550295804 +0200
+++ em8300-cgmeiner/modules/em8300_main.c 2011-06-11 15:56:46.345002204 +0200
@@ -52,8 +52,10 @@
#include <linux/i2c-algo-bit.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,38)
#include <linux/smp_lock.h>
#endif
+#endif
#include "em8300_compat24.h"
#include "encoder.h"
@@ -206,7 +208,9 @@
int subdevice = EM8300_IMINOR(inode) % 4;
long ret;
+#ifdef CONFIG_KERNEL_LOCK
lock_kernel();
+#endif
switch (subdevice) {
case EM8300_SUBDEVICE_AUDIO:
ret = em8300_audio_ioctl(em, cmd, arg);
@@ -217,8 +221,9 @@
case EM8300_SUBDEVICE_CONTROL:
ret = em8300_control_ioctl(em, cmd, arg);
}
+#ifdef CONFIG_KERNEL_LOCK
unlock_kernel();
-
+#endif
return ret;
}
@@ -534,9 +539,13 @@
struct em8300_s *em = filp->private_data;
long ret;
+#ifdef CONFIG_KERNEL_LOCK
lock_kernel();
+#endif
ret = em8300_audio_ioctl(em, cmd, arg);
+#ifdef CONFIG_KERNEL_LOCK
unlock_kernel();
+#endif
return ret;
}
@@ -877,7 +886,7 @@
init_waitqueue_head(&em->sp_ptsfifo_wait);
em->audio_driver_style = NONE;
- init_MUTEX(&em->audio_driver_style_lock);
+ sema_init(&em->audio_driver_style_lock,1);
result = request_irq(dev->irq, em8300_irq, IRQF_SHARED | IRQF_DISABLED, "em8300", (void *) em);
|