File: maestro3.patch

package info (click to toggle)
alsa-driver 1.0.13-5etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 20,108 kB
  • ctags: 50,477
  • sloc: ansic: 319,881; sh: 32,930; makefile: 2,015; python: 1,527; perl: 1,316; xml: 896; awk: 66
file content (53 lines) | stat: -rw-r--r-- 1,722 bytes parent folder | download | duplicates (2)
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
--- ../alsa-kernel/pci/maestro3.c	2006-03-28 12:50:56.000000000 +0200
+++ maestro3.c	2006-03-28 12:52:12.000000000 +0200
@@ -2665,6 +2665,7 @@
 	int i, err;
 	const struct m3_quirk *quirk;
 	const struct m3_hv_quirk *hv_quirk;
+	u16 subsystem_vendor, subsystem_device;
 	static struct snd_device_ops ops = {
 		.dev_free =	snd_m3_dev_free,
 	};
@@ -2688,6 +2689,14 @@
 		return -ENOMEM;
 	}
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 0)
+	subsystem_vendor = pci->subsystem_vendor;
+	subsystem_device = pci->subsystem_device;
+#else
+	pci_read_config_word(pci, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor);
+	pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &subsystem_device);
+#endif
+
 	spin_lock_init(&chip->reg_lock);
 	spin_lock_init(&chip->ac97_lock);
 
@@ -2705,8 +2714,8 @@
 	chip->irq = -1;
 
 	for (quirk = m3_quirk_list; quirk->vendor; quirk++) {
-		if (pci->subsystem_vendor == quirk->vendor &&
-		    pci->subsystem_device == quirk->device) {
+		if (subsystem_vendor == quirk->vendor &&
+		    subsystem_device == quirk->device) {
 			printk(KERN_INFO "maestro3: enabled hack for '%s'\n", quirk->name);
 			chip->quirk = quirk;
 			break;
@@ -2716,8 +2725,8 @@
 	for (hv_quirk = m3_hv_quirk_list; hv_quirk->vendor; hv_quirk++) {
 		if (pci->vendor == hv_quirk->vendor &&
 		    pci->device == hv_quirk->device &&
-		    pci->subsystem_vendor == hv_quirk->subsystem_vendor &&
-		    pci->subsystem_device == hv_quirk->subsystem_device) {
+		    subsystem_vendor == hv_quirk->subsystem_vendor &&
+		    subsystem_device == hv_quirk->subsystem_device) {
 			chip->hv_quirk = hv_quirk;
 			break;
 		}
@@ -2901,3 +2910,5 @@
 
 module_init(alsa_card_m3_init)
 module_exit(alsa_card_m3_exit)
+
+EXPORT_NO_SYMBOLS;