[ALSA] Fix synchronize_irq() bugs, redundancies
[safe/jmp/linux-2.6] / sound / pci / au88x0 / au88x0.c
index 238154b..68368e4 100644 (file)
@@ -126,7 +126,6 @@ static int snd_vortex_dev_free(struct snd_device *device)
        vortex_gameport_unregister(vortex);
        vortex_core_shutdown(vortex);
        // Take down PCI interface.
-       synchronize_irq(vortex->irq);
        free_irq(vortex->irq, vortex);
        iounmap(vortex->mmio);
        pci_release_regions(vortex->pci_dev);
@@ -191,7 +190,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
 
        /* Init audio core.
         * This must be done before we do request_irq otherwise we can get spurious
-        * interupts that we do not handle properly and make a mess of things */
+        * interrupts that we do not handle properly and make a mess of things */
        if ((err = vortex_core_init(chip)) != 0) {
                printk(KERN_ERR "hw core init failed\n");
                goto core_out;
@@ -220,7 +219,6 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
        return 0;
 
       alloc_out:
-       synchronize_irq(chip->irq);
        free_irq(chip->irq, chip);
       irq_out:
        vortex_core_shutdown(chip);
@@ -232,6 +230,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
        pci_disable_device(chip->pci_dev);
        //FIXME: this not the right place to unregister the gameport
        vortex_gameport_unregister(chip);
+       kfree(chip);
        return err;
 }
 
@@ -341,11 +340,7 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                snd_card_free(card);
                return err;
        }
-       if ((err = pci_read_config_byte(pci, PCI_REVISION_ID,
-                                 &(chip->rev))) < 0) {
-               snd_card_free(card);
-               return err;
-       }
+       chip->rev = pci->revision;
 #ifdef CHIP_AU8830
        if ((chip->rev) != 0xfe && (chip->rev) != 0xfa) {
                printk(KERN_ALERT