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.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index 7f835d46dc1c..703770f6a507 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -318,13 +318,12 @@ static void ali_read_regs(ali_t *codec, int channel)
318static void ali_read_cfg(unsigned int vendor, unsigned deviceid) 318static void ali_read_cfg(unsigned int vendor, unsigned deviceid)
319{ 319{
320 unsigned int dwVal; 320 unsigned int dwVal;
321 struct pci_dev *pci_dev = NULL; 321 struct pci_dev *pci_dev;
322 int i,j; 322 int i,j;
323 323
324 324 pci_dev = pci_get_device(vendor, deviceid, NULL);
325 pci_dev = pci_find_device(vendor, deviceid, pci_dev); 325 if (pci_dev == NULL)
326 if (pci_dev == NULL) 326 return ;
327 return ;
328 327
329 printk("\nM%x PCI CFG\n", deviceid); 328 printk("\nM%x PCI CFG\n", deviceid);
330 printk(" "); 329 printk(" ");
@@ -341,6 +340,7 @@ static void ali_read_cfg(unsigned int vendor, unsigned deviceid)
341 } 340 }
342 printk("\n"); 341 printk("\n");
343 } 342 }
343 pci_dev_put(pci_dev);
344 } 344 }
345static void ali_read_ac97regs(ali_t *codec, int secondary) 345static void ali_read_ac97regs(ali_t *codec, int secondary)
346{ 346{
@@ -2108,6 +2108,8 @@ static int snd_ali_free(ali_t * codec)
2108#ifdef CONFIG_PM 2108#ifdef CONFIG_PM
2109 kfree(codec->image); 2109 kfree(codec->image);
2110#endif 2110#endif
2111 pci_dev_put(codec->pci_m1533);
2112 pci_dev_put(codec->pci_m7101);
2111 kfree(codec); 2113 kfree(codec);
2112 return 0; 2114 return 0;
2113} 2115}
@@ -2297,7 +2299,7 @@ static int __devinit snd_ali_create(snd_card_t * card,
2297 codec->chregs.data.ainten = 0x00; 2299 codec->chregs.data.ainten = 0x00;
2298 2300
2299 /* M1533: southbridge */ 2301 /* M1533: southbridge */
2300 pci_dev = pci_find_device(0x10b9, 0x1533, NULL); 2302 pci_dev = pci_get_device(0x10b9, 0x1533, NULL);
2301 codec->pci_m1533 = pci_dev; 2303 codec->pci_m1533 = pci_dev;
2302 if (! codec->pci_m1533) { 2304 if (! codec->pci_m1533) {
2303 snd_printk(KERN_ERR "ali5451: cannot find ALi 1533 chip.\n"); 2305 snd_printk(KERN_ERR "ali5451: cannot find ALi 1533 chip.\n");
@@ -2305,7 +2307,7 @@ static int __devinit snd_ali_create(snd_card_t * card,
2305 return -ENODEV; 2307 return -ENODEV;
2306 } 2308 }
2307 /* M7101: power management */ 2309 /* M7101: power management */
2308 pci_dev = pci_find_device(0x10b9, 0x7101, NULL); 2310 pci_dev = pci_get_device(0x10b9, 0x7101, NULL);
2309 codec->pci_m7101 = pci_dev; 2311 codec->pci_m7101 = pci_dev;
2310 if (! codec->pci_m7101 && codec->revision == ALI_5451_V02) { 2312 if (! codec->pci_m7101 && codec->revision == ALI_5451_V02) {
2311 snd_printk(KERN_ERR "ali5451: cannot find ALi 7101 chip.\n"); 2313 snd_printk(KERN_ERR "ali5451: cannot find ALi 7101 chip.\n");