[ALSA] Fix synchronize_irq() bugs, redundancies

free_irq() calls synchronize_irq() for you, so there is no need for
drivers to manually do the same thing (again).  Thus, calls where
sync-irq immediately precedes free-irq can be simplified.

However, during this audit several bugs were noticed, where free-irq is
preceded by a "irq >= 0" check... but the sync-irq call is not covered
by the same check.

So, where sync-irq could not be eliminated completely, the missing check
was added.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Jeff Garzik
2008-04-22 13:50:34 +02:00
zatwierdzone przez Takashi Iwai
rodzic 8a87c9cf99
commit f000fd8093
22 zmienionych plików z 23 dodań i 46 usunięć

Wyświetl plik

@@ -410,10 +410,8 @@ static void oxygen_card_free(struct snd_card *card)
oxygen_write16(chip, OXYGEN_DMA_STATUS, 0);
oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, 0);
spin_unlock_irq(&chip->reg_lock);
if (chip->irq >= 0) {
if (chip->irq >= 0)
free_irq(chip->irq, chip);
synchronize_irq(chip->irq);
}
flush_scheduled_work();
chip->model->cleanup(chip);
mutex_destroy(&chip->mutex);