1 --- bulk.c.orig 2011-01-31 20:42:56.463333356 +0100
2 +++ bulk.c 2011-02-02 18:35:12.453333307 +0100
5 #include <linux/delay.h>
6 #include <linux/version.h> /* For LINUX_VERSION_CODE */
7 +#include <linux/semaphore.h>
8 #if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) )
9 #include <sound/driver.h>
11 @@ -3062,7 +3063,7 @@ int hdj_create_bulk_interface(struct snd
12 goto hdj_create_bulk_interface_error;
14 /* allocate the buffer for bulk_out_urb */
15 - init_MUTEX(&ubulk->bulk_out_buffer_mutex);
16 + sema_init(&ubulk->bulk_out_buffer_mutex,1);
18 ubulk->bulk_out_buffer =
19 usb_alloc_coherent(ubulk->chip->dev, ubulk->bulk_out_size,
20 @@ -3601,7 +3602,7 @@ static int init_output_control_state(str
24 - init_MUTEX(&ubulk->output_control_mutex);
25 + sema_init(&ubulk->output_control_mutex,1);
26 init_completion(&ubulk->output_control_completion);
28 /* Every product here except the Steel targets HID. Since the steel does not target HID, we don't
29 @@ -3855,7 +3856,7 @@ int hdjbulk_init_dj_console(struct usb_h
31 struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context);
33 - init_MUTEX(&dc->device_config_mutex);
34 + sema_init(&dc->device_config_mutex,1);
36 ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common);
38 @@ -4133,7 +4134,7 @@ int hdjbulk_init_dj_steel(struct usb_hdj
40 spin_lock_init(&dc->bulk_buffer_lock);
41 init_completion(&dc->bulk_request_completion);
42 - init_MUTEX(&dc->bulk_request_mutex);
43 + sema_init(&dc->bulk_request_mutex,1);
45 if ((ret = init_continuous_reader(ubulk))!=0) {
46 printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n",
48 --- device.c.orig 2011-01-31 20:42:56.470000023 +0100
49 +++ device.c 2011-02-02 18:37:06.129999924 +0100
50 @@ -66,7 +66,7 @@ MODULE_PARM_DESC(index, "Index value for
51 module_param_array(id, charp, NULL, 0444);
52 MODULE_PARM_DESC(id, "ID string for the Hercules DJ Series adapter.");
54 -static DECLARE_MUTEX(register_mutex);
55 +static DEFINE_SEMAPHORE(register_mutex);
56 static struct snd_hdj_chip *usb_chip[SNDRV_CARDS];
58 /* reference count for the socket */
59 @@ -1681,7 +1681,7 @@ static int snd_hdj_chip_create(struct us
61 chip->product_code = product_code;
63 - init_MUTEX(&chip->vendor_request_mutex);
64 + sema_init(&chip->vendor_request_mutex,1);
66 /* initialise the atomic variables */
67 atomic_set(&chip->locked_io, 0);
68 @@ -1696,7 +1696,7 @@ static int snd_hdj_chip_create(struct us
69 INIT_LIST_HEAD(&chip->bulk_list);
70 chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
71 le16_to_cpu(dev->descriptor.idProduct));
72 - init_MUTEX(&chip->netlink_list_mutex);
73 + sema_init(&chip->netlink_list_mutex,1);
74 INIT_LIST_HEAD(&chip->netlink_registered_processes);
76 /* fill in DJ capabilities for this device */
78 --- midi.c.orig 2011-01-31 20:42:56.470000023 +0100
79 +++ midi.c 2011-02-02 18:38:31.653333225 +0100
81 #include <linux/module.h>
82 #include <linux/usb.h>
83 #include <linux/kthread.h>
84 +#include <linux/semaphore.h>
85 #include <asm/byteorder.h>
86 #include <asm/atomic.h>
87 #if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) )
88 @@ -677,7 +678,7 @@ static int controller_output_init(struct
90 /* this buffer and URB below are for general control requests, like changing the
91 * mouse setting or setting LEDs */
92 - init_MUTEX(&controller_state->output_control_ctl_mutex);
93 + sema_init(&controller_state->output_control_ctl_mutex, 1);
94 init_completion(&controller_state->output_control_ctl_completion);
95 controller_state->output_control_ctl_req = usb_alloc_coherent(ep->umidi->chip->dev,
96 sizeof(*(controller_state->output_control_ctl_req)),