From ff66a057b8b67749b41fc0ce0298c367952a27fc Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Tue, 20 Dec 2005 17:10:17 +0000 Subject: Fix saa7134 ALSA/OSS collisions From: Ricardo Cerqueira When ALSA or OSS are loaded, check if the other is present Fixed hotplug notifiers cleanup on module removal Signed-off-by: --- linux/drivers/media/video/saa7134/saa7134-alsa.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'linux/drivers/media/video/saa7134/saa7134-alsa.c') diff --git a/linux/drivers/media/video/saa7134/saa7134-alsa.c b/linux/drivers/media/video/saa7134/saa7134-alsa.c index 83f0bc4e2..d05c519d4 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.31 2005/12/18 00:44:19 mchehab Exp $ + * $Id: saa7134-alsa.c,v 1.32 2005/12/20 17:10:17 rmcc Exp $ * * Caveats: * - Volume doesn't work (it's always at max) @@ -1000,6 +1000,14 @@ static int saa7134_alsa_init(void) struct saa7134_dev *dev = NULL; struct list_head *list; + if (!dmasound_init && !dmasound_exit) { + dmasound_init = alsa_device_init; + dmasound_exit = alsa_device_exit; + } else { + printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n"); + return -EBUSY; + } + printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); list_for_each(list,&saa7134_devlist) { @@ -1012,9 +1020,6 @@ static int saa7134_alsa_init(void) } } - dmasound_init = alsa_device_init; - dmasound_exit = alsa_device_exit; - if (dev == NULL) printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); @@ -1034,6 +1039,8 @@ static void saa7134_alsa_exit(void) snd_card_free(snd_saa7134_cards[idx]); } + dmasound_init = NULL; + dmasound_exit = NULL; printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); return; -- cgit v1.2.3