Merge branch 'topic/pcsp-fix' into topic/misc
[sfrench/cifs-2.6.git] / sound / pci / mixart / mixart.c
index 2d0dce649a644fe4a5adc479ae76e53a541b3025..f23a73577c2219cb7da2b03317bf1106b7e1f981 100644 (file)
@@ -1010,7 +1010,7 @@ static int __devinit snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *
                .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;
@@ -1025,6 +1025,7 @@ static int __devinit snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *
                return err;
        }
 
+       mgr->chip[idx] = chip;
        snd_card_set_dev(card, &mgr->pci->dev);
 
        return 0;
@@ -1314,8 +1315,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
        }
        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);
@@ -1378,6 +1378,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
                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;
                }