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