aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/es1938.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@redhat.com>2008-04-22 07:50:34 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:40 -0400
commitf000fd80937c0d94c67f9f3e7026f1fbc8ef8873 (patch)
treea1364921df5ed78b387a767787ea945031b5b641 /sound/pci/es1938.c
parent8a87c9cf999542db846c3ab93c1065d446427f37 (diff)
[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>
Diffstat (limited to 'sound/pci/es1938.c')
-rw-r--r--sound/pci/es1938.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 1a314fa99c45..84fac1fbf103 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -1488,7 +1488,6 @@ static int es1938_suspend(struct pci_dev *pci, pm_message_t state)
1488 1488
1489 outb(0x00, SLIO_REG(chip, IRQCONTROL)); /* disable irqs */ 1489 outb(0x00, SLIO_REG(chip, IRQCONTROL)); /* disable irqs */
1490 if (chip->irq >= 0) { 1490 if (chip->irq >= 0) {
1491 synchronize_irq(chip->irq);
1492 free_irq(chip->irq, chip); 1491 free_irq(chip->irq, chip);
1493 chip->irq = -1; 1492 chip->irq = -1;
1494 } 1493 }
@@ -1578,10 +1577,8 @@ static int snd_es1938_free(struct es1938 *chip)
1578 1577
1579 snd_es1938_free_gameport(chip); 1578 snd_es1938_free_gameport(chip);
1580 1579
1581 if (chip->irq >= 0) { 1580 if (chip->irq >= 0)
1582 synchronize_irq(chip->irq);
1583 free_irq(chip->irq, chip); 1581 free_irq(chip->irq, chip);
1584 }
1585 pci_release_regions(chip->pci); 1582 pci_release_regions(chip->pci);
1586 pci_disable_device(chip->pci); 1583 pci_disable_device(chip->pci);
1587 kfree(chip); 1584 kfree(chip);