File: bt87x.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 (48 lines) | stat: -rw-r--r-- 1,844 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
--- ../alsa-kernel/pci/bt87x.c	2006-02-09 21:57:19.000000000 +0100
+++ bt87x.c	2006-02-09 22:13:18.000000000 +0100
@@ -810,21 +810,34 @@
 {
 	int i;
 	const struct pci_device_id *supported;
+	u16 subsystem_vendor, subsystem_device;
 
-	supported = pci_match_device(&driver, pci);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+        supported = pci_match_device(&driver, pci);
+#else
+        supported = pci_match_device(snd_bt87x_ids, pci);
+#endif
 	if (supported && supported->driver_data > 0)
 		return supported->driver_data;
 
+#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
+
 	for (i = 0; i < ARRAY_SIZE(blacklist); ++i)
-		if (blacklist[i].subvendor == pci->subsystem_vendor &&
-		    blacklist[i].subdevice == pci->subsystem_device) {
+		if (blacklist[i].subvendor == subsystem_vendor &&
+		    blacklist[i].subdevice == subsystem_device) {
 			snd_printdd(KERN_INFO "card %#04x-%#04x:%#04x has no audio\n",
-				    pci->device, pci->subsystem_vendor, pci->subsystem_device);
+				    pci->device, subsystem_vendor, subsystem_device);
 			return -EBUSY;
 		}
 
 	snd_printk(KERN_INFO "unknown card %#04x-%#04x:%#04x, using default rate 32000\n",
-	           pci->device, pci->subsystem_vendor, pci->subsystem_device);
+	           pci->device, subsystem_vendor, subsystem_device);
 	snd_printk(KERN_DEBUG "please mail id, board name, and, "
 		   "if it works, the correct digital_rate option to "
 		   "<alsa-devel@lists.sf.net>\n");
@@ -935,3 +948,5 @@
 
 module_init(alsa_card_bt87x_init)
 module_exit(alsa_card_bt87x_exit)
+
+EXPORT_NO_SYMBOLS;