aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ali5451/ali5451.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ali5451/ali5451.c')
-rw-r--r--sound/pci/ali5451/ali5451.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index 4943299cf137..d683f7736a63 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -78,15 +78,7 @@ MODULE_PARM_DESC(spdif, "Support SPDIF I/O");
78 * Constants definition 78 * Constants definition
79 */ 79 */
80 80
81#ifndef PCI_VENDOR_ID_ALI 81#define DEVICE_ID_ALI5451 ((PCI_VENDOR_ID_AL<<16)|PCI_DEVICE_ID_AL_M5451)
82#define PCI_VENDOR_ID_ALI 0x10b9
83#endif
84
85#ifndef PCI_DEVICE_ID_ALI_5451
86#define PCI_DEVICE_ID_ALI_5451 0x5451
87#endif
88
89#define DEVICE_ID_ALI5451 ((PCI_VENDOR_ID_ALI<<16)|PCI_DEVICE_ID_ALI_5451)
90 82
91 83
92#define ALI_CHANNELS 32 84#define ALI_CHANNELS 32
@@ -326,13 +318,12 @@ static void ali_read_regs(ali_t *codec, int channel)
326static void ali_read_cfg(unsigned int vendor, unsigned deviceid) 318static void ali_read_cfg(unsigned int vendor, unsigned deviceid)
327{ 319{
328 unsigned int dwVal; 320 unsigned int dwVal;
329 struct pci_dev *pci_dev = NULL; 321 struct pci_dev *pci_dev;
330 int i,j; 322 int i,j;
331 323
332 324 pci_dev = pci_get_device(vendor, deviceid, NULL);
333 pci_dev = pci_find_device(vendor, deviceid, pci_dev); 325 if (pci_dev == NULL)
334 if (pci_dev == NULL) 326 return ;
335 return ;
336 327
337 printk("\nM%x PCI CFG\n", deviceid); 328 printk("\nM%x PCI CFG\n", deviceid);
338 printk(" "); 329 printk(" ");
@@ -349,6 +340,7 @@ static void ali_read_cfg(unsigned int vendor, unsigned deviceid)
349 } 340 }
350 printk("\n"); 341 printk("\n");
351 } 342 }
343 pci_dev_put(pci_dev);
352 } 344 }
353static void ali_read_ac97regs(ali_t *codec, int secondary) 345static void ali_read_ac97regs(ali_t *codec, int secondary)
354{ 346{
@@ -2116,6 +2108,8 @@ static int snd_ali_free(ali_t * codec)
2116#ifdef CONFIG_PM 2108#ifdef CONFIG_PM
2117 kfree(codec->image); 2109 kfree(codec->image);
2118#endif 2110#endif
2111 pci_dev_put(codec->pci_m1533);
2112 pci_dev_put(codec->pci_m7101);
2119 kfree(codec); 2113 kfree(codec);
2120 return 0; 2114 return 0;
2121} 2115}
@@ -2305,7 +2299,7 @@ static int __devinit snd_ali_create(snd_card_t * card,
2305 codec->chregs.data.ainten = 0x00; 2299 codec->chregs.data.ainten = 0x00;
2306 2300
2307 /* M1533: southbridge */ 2301 /* M1533: southbridge */
2308 pci_dev = pci_find_device(0x10b9, 0x1533, NULL); 2302 pci_dev = pci_get_device(0x10b9, 0x1533, NULL);
2309 codec->pci_m1533 = pci_dev; 2303 codec->pci_m1533 = pci_dev;
2310 if (! codec->pci_m1533) { 2304 if (! codec->pci_m1533) {
2311 snd_printk(KERN_ERR "ali5451: cannot find ALi 1533 chip.\n"); 2305 snd_printk(KERN_ERR "ali5451: cannot find ALi 1533 chip.\n");
@@ -2313,7 +2307,7 @@ static int __devinit snd_ali_create(snd_card_t * card,
2313 return -ENODEV; 2307 return -ENODEV;
2314 } 2308 }
2315 /* M7101: power management */ 2309 /* M7101: power management */
2316 pci_dev = pci_find_device(0x10b9, 0x7101, NULL); 2310 pci_dev = pci_get_device(0x10b9, 0x7101, NULL);
2317 codec->pci_m7101 = pci_dev; 2311 codec->pci_m7101 = pci_dev;
2318 if (! codec->pci_m7101 && codec->revision == ALI_5451_V02) { 2312 if (! codec->pci_m7101 && codec->revision == ALI_5451_V02) {
2319 snd_printk(KERN_ERR "ali5451: cannot find ALi 7101 chip.\n"); 2313 snd_printk(KERN_ERR "ali5451: cannot find ALi 7101 chip.\n");
@@ -2417,6 +2411,7 @@ static void __devexit snd_ali_remove(struct pci_dev *pci)
2417 2411
2418static struct pci_driver driver = { 2412static struct pci_driver driver = {
2419 .name = "ALI 5451", 2413 .name = "ALI 5451",
2414 .owner = THIS_MODULE,
2420 .id_table = snd_ali_ids, 2415 .id_table = snd_ali_ids,
2421 .probe = snd_ali_probe, 2416 .probe = snd_ali_probe,
2422 .remove = __devexit_p(snd_ali_remove), 2417 .remove = __devexit_p(snd_ali_remove),