]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
Merge branch 'topic/pcsp-fix' into topic/misc
authorTakashi Iwai <tiwai@suse.de>
Sat, 20 Dec 2008 22:39:47 +0000 (23:39 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sat, 20 Dec 2008 22:39:47 +0000 (23:39 +0100)
1  2 
sound/pci/mixart/mixart.c
sound/pci/pcxhr/pcxhr.c

index fd9a117f37a42649cf237b008988c9ce7b9bb922,ae7601f353a706d0f69ca0a31195104b3040beb8..f23a73577c2219cb7da2b03317bf1106b7e1f981
@@@ -1010,7 -1010,7 +1010,7 @@@ static int __devinit snd_mixart_create(
                .dev_free = snd_mixart_chip_dev_free,
        };
  
 -      mgr->chip[idx] = chip = kzalloc(sizeof(*chip), GFP_KERNEL);
 +      chip = kzalloc(sizeof(*chip), GFP_KERNEL);
        if (! chip) {
                snd_printk(KERN_ERR "cannot allocate chip\n");
                return -ENOMEM;
                return err;
        }
  
 +      mgr->chip[idx] = chip;
        snd_card_set_dev(card, &mgr->pci->dev);
  
        return 0;
@@@ -1315,8 -1314,7 +1315,7 @@@ static int __devinit snd_mixart_probe(s
        }
        for (i = 0; i < 2; i++) {
                mgr->mem[i].phys = pci_resource_start(pci, i);
-               mgr->mem[i].virt = ioremap_nocache(mgr->mem[i].phys,
-                                                  pci_resource_len(pci, i));
+               mgr->mem[i].virt = pci_ioremap_bar(pci, i);
                if (!mgr->mem[i].virt) {
                        printk(KERN_ERR "unable to remap resource 0x%lx\n",
                               mgr->mem[i].phys);
                sprintf(card->longname, "%s [PCM #%d]", mgr->longname, i);
  
                if ((err = snd_mixart_create(mgr, card, i)) < 0) {
 +                      snd_card_free(card);
                        snd_mixart_free(mgr);
                        return err;
                }
diff --combined sound/pci/pcxhr/pcxhr.c
index 58621206a2b3a69881cdbff074d55215eaae55ad,73de6e989b3d4ab78069d8b24240637890fd3131..7d2b136295d5304249aef42362dbf7f148487973
@@@ -1024,7 -1024,7 +1024,7 @@@ static int __devinit pcxhr_create(struc
                .dev_free = pcxhr_chip_dev_free,
        };
  
 -      mgr->chip[idx] = chip = kzalloc(sizeof(*chip), GFP_KERNEL);
 +      chip = kzalloc(sizeof(*chip), GFP_KERNEL);
        if (! chip) {
                snd_printk(KERN_ERR "cannot allocate chip\n");
                return -ENOMEM;
                return err;
        }
  
 +      mgr->chip[idx] = chip;
        snd_card_set_dev(card, &mgr->pci->dev);
  
        return 0;
@@@ -1230,8 -1229,11 +1230,11 @@@ static int __devinit pcxhr_probe(struc
                return -ENOMEM;
        }
  
-       if (snd_BUG_ON(pci_id->driver_data >= PCI_ID_LAST))
+       if (snd_BUG_ON(pci_id->driver_data >= PCI_ID_LAST)) {
+               kfree(mgr);
+               pci_disable_device(pci);
                return -ENODEV;
+       }
        card_name = pcxhr_board_params[pci_id->driver_data].board_name;
        mgr->playback_chips = pcxhr_board_params[pci_id->driver_data].playback_chips;
        mgr->capture_chips  = pcxhr_board_params[pci_id->driver_data].capture_chips;
                sprintf(card->longname, "%s [PCM #%d]", mgr->longname, i);
  
                if ((err = pcxhr_create(mgr, card, i)) < 0) {
 +                      snd_card_free(card);
                        pcxhr_free(mgr);
                        return err;
                }