Merge branch 'topic/misc' into for-linus
[safe/jmp/linux-2.6] / sound / pci / intel8x0m.c
index cadda8d..33a843c 100644 (file)
@@ -306,7 +306,8 @@ static unsigned int get_ich_codec_bit(struct intel8x0m *chip, unsigned int codec
        static unsigned int codec_bit[3] = {
                ICH_PCR, ICH_SCR, ICH_TCR
        };
-       snd_assert(codec < 3, return ICH_PCR);
+       if (snd_BUG_ON(codec >= 3))
+               return ICH_PCR;
        return codec_bit[codec];
 }
 
@@ -985,17 +986,15 @@ static int snd_intel8x0_free(struct intel8x0m *chip)
        /* reset channels */
        for (i = 0; i < chip->bdbars_count; i++)
                iputbyte(chip, ICH_REG_OFF_CR + chip->ichd[i].reg_offset, ICH_RESETREGS);
-       /* --- */
-       synchronize_irq(chip->irq);
-      __hw_end:
+ __hw_end:
+       if (chip->irq >= 0)
+               free_irq(chip->irq, chip);
        if (chip->bdbars.area)
                snd_dma_free_pages(&chip->bdbars);
        if (chip->addr)
                pci_iounmap(chip->pci, chip->addr);
        if (chip->bmaddr)
                pci_iounmap(chip->pci, chip->bmaddr);
-       if (chip->irq >= 0)
-               free_irq(chip->irq, chip);
        pci_release_regions(chip->pci);
        pci_disable_device(chip->pci);
        kfree(chip);
@@ -1017,7 +1016,6 @@ static int intel8x0m_suspend(struct pci_dev *pci, pm_message_t state)
                snd_pcm_suspend_all(chip->pcm[i]);
        snd_ac97_suspend(chip->ac97);
        if (chip->irq >= 0) {
-               synchronize_irq(chip->irq);
                free_irq(chip->irq, chip);
                chip->irq = -1;
        }
@@ -1271,9 +1269,9 @@ static int __devinit snd_intel8x0m_probe(struct pci_dev *pci,
        int err;
        struct shortname_table *name;
 
-       card = snd_card_new(index, id, THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
 
        strcpy(card->driver, "ICH-MODEM");
        strcpy(card->shortname, "Intel ICH");