Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 272100 | Differences between
and this patch

Collapse All | Expand All

(-)bulk.c.orig (+19 lines)
Lines 34-39 Link Here
34
#include <linux/usb.h>
34
#include <linux/usb.h>
35
#include <linux/delay.h>
35
#include <linux/delay.h>
36
#include <linux/version.h>	/* For LINUX_VERSION_CODE */
36
#include <linux/version.h>	/* For LINUX_VERSION_CODE */
37
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) )
38
#include <linux/semaphore.h>
39
#endif
37
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )
40
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )
38
#include <linux/slab.h>
41
#include <linux/slab.h>
39
#endif
42
#endif
Lines 3086-3092 Link Here
3086
		goto hdj_create_bulk_interface_error;
3089
		goto hdj_create_bulk_interface_error;
3087
	}
3090
	}
3088
	/* allocate the buffer for bulk_out_urb */
3091
	/* allocate the buffer for bulk_out_urb */
3092
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) )
3093
	sema_init(&ubulk->bulk_out_buffer_mutex,1);
3094
#else
3089
	init_MUTEX(&ubulk->bulk_out_buffer_mutex);
3095
	init_MUTEX(&ubulk->bulk_out_buffer_mutex);
3096
#endif
3090
	
3097
	
3091
	ubulk->bulk_out_buffer =
3098
	ubulk->bulk_out_buffer =
3092
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )
3099
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )
Lines 3633-3639 Link Here
3633
		return -EINVAL;
3640
		return -EINVAL;
3634
	}
3641
	}
3635
3642
3643
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) )
3644
	sema_init(&ubulk->output_control_mutex,1);
3645
#else
3636
	init_MUTEX(&ubulk->output_control_mutex);
3646
	init_MUTEX(&ubulk->output_control_mutex);
3647
#endif
3637
	init_completion(&ubulk->output_control_completion);
3648
	init_completion(&ubulk->output_control_completion);
3638
3649
3639
	/* Every product here except the Steel targets HID.  Since the steel does not target HID, we don't
3650
	/* Every product here except the Steel targets HID.  Since the steel does not target HID, we don't
Lines 3907-3913 Link Here
3907
	u16 value = 0;
3918
	u16 value = 0;
3908
	struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context);
3919
	struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context);
3909
3920
3921
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) )
3922
	sema_init(&dc->device_config_mutex,1);
3923
#else
3910
	init_MUTEX(&dc->device_config_mutex);
3924
	init_MUTEX(&dc->device_config_mutex);
3925
#endif
3911
	
3926
	
3912
	ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common);
3927
	ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common);
3913
	if (ret!=0) {
3928
	if (ret!=0) {
Lines 4185-4191 Link Here
4185
4200
4186
	spin_lock_init(&dc->bulk_buffer_lock);
4201
	spin_lock_init(&dc->bulk_buffer_lock);
4187
	init_completion(&dc->bulk_request_completion);
4202
	init_completion(&dc->bulk_request_completion);
4203
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) )
4204
	sema_init(&dc->bulk_request_mutex,1);
4205
#else
4188
	init_MUTEX(&dc->bulk_request_mutex);
4206
	init_MUTEX(&dc->bulk_request_mutex);
4207
#endif
4189
4208
4190
	if ((ret = init_continuous_reader(ubulk))!=0) {
4209
	if ((ret = init_continuous_reader(ubulk))!=0) {
4191
		printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n",
4210
		printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n",
(-)device.c.orig (+12 lines)
Lines 66-72 Link Here
66
module_param_array(id, charp, NULL, 0444);
66
module_param_array(id, charp, NULL, 0444);
67
MODULE_PARM_DESC(id, "ID string for the Hercules DJ Series adapter.");
67
MODULE_PARM_DESC(id, "ID string for the Hercules DJ Series adapter.");
68
68
69
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) )
70
static DEFINE_SEMAPHORE(register_mutex);
71
#else
69
static DECLARE_MUTEX(register_mutex);
72
static DECLARE_MUTEX(register_mutex);
73
#endif
70
static struct snd_hdj_chip *usb_chip[SNDRV_CARDS];
74
static struct snd_hdj_chip *usb_chip[SNDRV_CARDS];
71
75
72
/* reference count for the socket */
76
/* reference count for the socket */
Lines 1698-1704 Link Here
1698
	chip->card = card;
1702
	chip->card = card;
1699
	chip->product_code = product_code;
1703
	chip->product_code = product_code;
1700
1704
1705
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) )
1706
	sema_init(&chip->vendor_request_mutex,1);
1707
#else
1701
	init_MUTEX(&chip->vendor_request_mutex);
1708
	init_MUTEX(&chip->vendor_request_mutex);
1709
#endif
1702
1710
1703
	/* initialise the atomic variables */
1711
	/* initialise the atomic variables */
1704
	atomic_set(&chip->locked_io, 0);
1712
	atomic_set(&chip->locked_io, 0);
Lines 1713-1719 Link Here
1713
	INIT_LIST_HEAD(&chip->bulk_list);
1721
	INIT_LIST_HEAD(&chip->bulk_list);
1714
	chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
1722
	chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
1715
			      le16_to_cpu(dev->descriptor.idProduct));
1723
			      le16_to_cpu(dev->descriptor.idProduct));
1724
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) )
1725
	sema_init(&chip->netlink_list_mutex,1);
1726
#else
1716
	init_MUTEX(&chip->netlink_list_mutex);
1727
	init_MUTEX(&chip->netlink_list_mutex);
1728
#endif
1717
	INIT_LIST_HEAD(&chip->netlink_registered_processes);
1729
	INIT_LIST_HEAD(&chip->netlink_registered_processes);
1718
	
1730
	
1719
	/* fill in DJ capabilities for this device */
1731
	/* fill in DJ capabilities for this device */
(-)midi.c.orig (+7 lines)
Lines 34-39 Link Here
34
#include <linux/module.h>
34
#include <linux/module.h>
35
#include <linux/usb.h>
35
#include <linux/usb.h>
36
#include <linux/kthread.h>
36
#include <linux/kthread.h>
37
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) )
38
#include <linux/semaphore.h>
39
#endif
37
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )
40
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )
38
#include <linux/slab.h>
41
#include <linux/slab.h>
39
#endif
42
#endif
Lines 732-738 Link Here
732
	
735
	
733
	/* this buffer and URB below are for general control requests, like changing the
736
	/* this buffer and URB below are for general control requests, like changing the
734
	 *  mouse setting or setting LEDs */
737
	 *  mouse setting or setting LEDs */
738
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) )
739
	sema_init(&controller_state->output_control_ctl_mutex, 1);
740
#else
735
	init_MUTEX(&controller_state->output_control_ctl_mutex);
741
	init_MUTEX(&controller_state->output_control_ctl_mutex);
742
#endif
736
	init_completion(&controller_state->output_control_ctl_completion);
743
	init_completion(&controller_state->output_control_ctl_completion);
737
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )
744
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )
738
	controller_state->output_control_ctl_req = usb_alloc_coherent(ep->umidi->chip->dev, 
745
	controller_state->output_control_ctl_req = usb_alloc_coherent(ep->umidi->chip->dev, 

Return to bug 272100