summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7134/saa7134-alsa.c
diff options
context:
space:
mode:
authorRicardo Cerqueira <devnull@localhost>2005-12-20 17:10:17 +0000
committerRicardo Cerqueira <devnull@localhost>2005-12-20 17:10:17 +0000
commitff66a057b8b67749b41fc0ce0298c367952a27fc (patch)
tree29f8059aaa1d3174a5aebcb790d064849b93f742 /linux/drivers/media/video/saa7134/saa7134-alsa.c
parent725a8b813082a250bf3727ecb2140144ab92c2eb (diff)
downloadmediapointer-dvb-s2-ff66a057b8b67749b41fc0ce0298c367952a27fc.tar.gz
mediapointer-dvb-s2-ff66a057b8b67749b41fc0ce0298c367952a27fc.tar.bz2
Fix saa7134 ALSA/OSS collisions
From: Ricardo Cerqueira <v4l@cerqueira.org> When ALSA or OSS are loaded, check if the other is present Fixed hotplug notifiers cleanup on module removal Signed-off-by:
Diffstat (limited to 'linux/drivers/media/video/saa7134/saa7134-alsa.c')
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-alsa.c15
1 files changed, 11 insertions, 4 deletions
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;