summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7134/saa7134-oss.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-oss.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-oss.c')
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-oss.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-oss.c b/linux/drivers/media/video/saa7134/saa7134-oss.c
index a2df1dff7..25d9032db 100644
--- a/linux/drivers/media/video/saa7134/saa7134-oss.c
+++ b/linux/drivers/media/video/saa7134/saa7134-oss.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-oss.c,v 1.31 2005/12/10 01:43:26 mchehab Exp $
+ * $Id: saa7134-oss.c,v 1.32 2005/12/20 17:10:17 rmcc Exp $
*
* device driver for philips saa7134 based TV cards
* oss dsp interface
@@ -982,8 +982,17 @@ static int saa7134_oss_init(void)
struct saa7134_dev *dev = NULL;
struct list_head *list;
+ if (!dmasound_init && !dmasound_exit) {
+ dmasound_init = oss_device_init;
+ dmasound_exit = oss_device_exit;
+ } else {
+ printk(KERN_WARNING "saa7134 OSS: can't load, DMA sound handler already assigned (probably to ALSA)\n");
+ return -EBUSY;
+ }
+
printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n");
+
list_for_each(list,&saa7134_devlist) {
dev = list_entry(list, struct saa7134_dev, devlist);
if (dev->dmasound.priv_data == NULL) {
@@ -997,9 +1006,6 @@ static int saa7134_oss_init(void)
if (dev == NULL)
printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n");
- dmasound_init = oss_device_init;
- dmasound_exit = oss_device_exit;
-
return 0;
}
@@ -1020,6 +1026,9 @@ static void saa7134_oss_exit(void)
}
+ dmasound_init = NULL;
+ dmasound_exit = NULL;
+
printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n");
return;