From d711c94f17eceb5a8da0bf673852d9a22e849e0f Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Mon, 7 Nov 2005 23:06:28 +0000 Subject: - Fix nasty IRQ hook bug. Signed-off-by: Ricardo Cerqueira --- linux/drivers/media/video/saa7134/saa7134-alsa.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/video/saa7134/saa7134-alsa.c b/linux/drivers/media/video/saa7134/saa7134-alsa.c index a65ac4be1..4a968dcaa 100644 --- a/linux/drivers/media/video/saa7134/saa7134-alsa.c +++ b/linux/drivers/media/video/saa7134/saa7134-alsa.c @@ -1,7 +1,7 @@ /* * SAA713x ALSA support for V4L * - * $Id: saa7134-alsa.c,v 1.14 2005/11/07 20:22:20 rmcc Exp $ + * $Id: saa7134-alsa.c,v 1.15 2005/11/07 23:06:28 rmcc Exp $ * * Caveats: * - Volume doesn't work (it's always at max) @@ -219,7 +219,8 @@ void saa7134_irq_alsa_done(struct saa7134_dev *dev, unsigned long status) static irqreturn_t saa7134_alsa_irq(int irq, void *dev_id, struct pt_regs *regs) { - struct saa7134_dev *dev = (struct saa7134_dev*) dev_id; + snd_card_saa7134_t *saa7134 = dev_id; + struct saa7134_dev *dev = saa7134->saadev; unsigned long report, status; int loop, handled = 0; @@ -910,6 +911,11 @@ static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip) static int snd_saa7134_free(snd_card_saa7134_t *chip) { + if (chip->irq >= 0) { + synchronize_irq(chip->irq); + free_irq(chip->irq, (void *) chip); + } + kfree(chip); return 0; } @@ -970,7 +976,7 @@ int alsa_card_saa7134_create (struct saa7134_dev *saadev) chip->iobase = pci_resource_start(saadev->pci, 0); err = request_irq(saadev->pci->irq, saa7134_alsa_irq, - SA_SHIRQ | SA_INTERRUPT, saadev->name, saadev); + SA_SHIRQ | SA_INTERRUPT, saadev->name, (void *)chip); if (err < 0) { printk(KERN_ERR "%s: can't get IRQ %d for ALSA\n", -- cgit v1.2.3