aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/au88x0/au88x0.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/au88x0/au88x0.c')
-rw-r--r--sound/pci/au88x0/au88x0.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
index f6236c63aaaa..04b695d6fd48 100644
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -79,19 +79,21 @@ static void vortex_fix_agp_bridge(struct pci_dev *via)
79 79
80static void __devinit snd_vortex_workaround(struct pci_dev *vortex, int fix) 80static void __devinit snd_vortex_workaround(struct pci_dev *vortex, int fix)
81{ 81{
82 struct pci_dev *via; 82 struct pci_dev *via = NULL;
83 83
84 /* autodetect if workarounds are required */ 84 /* autodetect if workarounds are required */
85 if (fix == 255) { 85 if (fix == 255) {
86 /* VIA KT133 */ 86 /* VIA KT133 */
87 via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8365_1, NULL); 87 via = pci_get_device(PCI_VENDOR_ID_VIA,
88 PCI_DEVICE_ID_VIA_8365_1, NULL);
88 /* VIA Apollo */ 89 /* VIA Apollo */
89 if (via == NULL) { 90 if (via == NULL) {
90 via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C598_1, NULL); 91 via = pci_get_device(PCI_VENDOR_ID_VIA,
91 } 92 PCI_DEVICE_ID_VIA_82C598_1, NULL);
92 /* AMD Irongate */ 93 /* AMD Irongate */
93 if (via == NULL) { 94 if (via == NULL)
94 via = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL); 95 via = pci_get_device(PCI_VENDOR_ID_AMD,
96 PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL);
95 } 97 }
96 if (via) { 98 if (via) {
97 printk(KERN_INFO CARD_NAME ": Activating latency workaround...\n"); 99 printk(KERN_INFO CARD_NAME ": Activating latency workaround...\n");
@@ -101,13 +103,17 @@ static void __devinit snd_vortex_workaround(struct pci_dev *vortex, int fix)
101 } else { 103 } else {
102 if (fix & 0x1) 104 if (fix & 0x1)
103 vortex_fix_latency(vortex); 105 vortex_fix_latency(vortex);
104 if ((fix & 0x2) && (via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8365_1, NULL))) 106 if ((fix & 0x2) && (via = pci_get_device(PCI_VENDOR_ID_VIA,
107 PCI_DEVICE_ID_VIA_8365_1, NULL)))
105 vortex_fix_agp_bridge(via); 108 vortex_fix_agp_bridge(via);
106 if ((fix & 0x4) && (via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C598_1, NULL))) 109 if ((fix & 0x4) && (via = pci_get_device(PCI_VENDOR_ID_VIA,
110 PCI_DEVICE_ID_VIA_82C598_1, NULL)))
107 vortex_fix_agp_bridge(via); 111 vortex_fix_agp_bridge(via);
108 if ((fix & 0x8) && (via = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL))) 112 if ((fix & 0x8) && (via = pci_get_device(PCI_VENDOR_ID_AMD,
113 PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL)))
109 vortex_fix_agp_bridge(via); 114 vortex_fix_agp_bridge(via);
110 } 115 }
116 pci_dev_put(via);
111} 117}
112 118
113// component-destructor 119// component-destructor
@@ -150,7 +156,7 @@ snd_vortex_create(snd_card_t * card, struct pci_dev *pci, vortex_t ** rchip)
150 } 156 }
151 pci_set_dma_mask(pci, VORTEX_DMA_MASK); 157 pci_set_dma_mask(pci, VORTEX_DMA_MASK);
152 158
153 chip = kcalloc(1, sizeof(*chip), GFP_KERNEL); 159 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
154 if (chip == NULL) 160 if (chip == NULL)
155 return -ENOMEM; 161 return -ENOMEM;
156 162
@@ -367,6 +373,7 @@ static void __devexit snd_vortex_remove(struct pci_dev *pci)
367// pci_driver definition 373// pci_driver definition
368static struct pci_driver driver = { 374static struct pci_driver driver = {
369 .name = CARD_NAME_SHORT, 375 .name = CARD_NAME_SHORT,
376 .owner = THIS_MODULE,
370 .id_table = snd_vortex_ids, 377 .id_table = snd_vortex_ids,
371 .probe = snd_vortex_probe, 378 .probe = snd_vortex_probe,
372 .remove = __devexit_p(snd_vortex_remove), 379 .remove = __devexit_p(snd_vortex_remove),