diff options
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-alsa.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-alsa.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index b24a26b065c2..ade05f75fdb0 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c | |||
@@ -60,7 +60,7 @@ module_param_array(index, int, NULL, 0444); | |||
60 | MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); | 60 | MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); |
61 | 61 | ||
62 | #define dprintk(fmt, arg...) if (debug) \ | 62 | #define dprintk(fmt, arg...) if (debug) \ |
63 | printk(KERN_DEBUG "%s/alsa: " fmt, dev->name, ## arg) | 63 | printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg) |
64 | 64 | ||
65 | 65 | ||
66 | 66 | ||
@@ -989,6 +989,14 @@ static int saa7134_alsa_init(void) | |||
989 | struct saa7134_dev *dev = NULL; | 989 | struct saa7134_dev *dev = NULL; |
990 | struct list_head *list; | 990 | struct list_head *list; |
991 | 991 | ||
992 | if (!dmasound_init && !dmasound_exit) { | ||
993 | dmasound_init = alsa_device_init; | ||
994 | dmasound_exit = alsa_device_exit; | ||
995 | } else { | ||
996 | printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n"); | ||
997 | return -EBUSY; | ||
998 | } | ||
999 | |||
992 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); | 1000 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); |
993 | 1001 | ||
994 | list_for_each(list,&saa7134_devlist) { | 1002 | list_for_each(list,&saa7134_devlist) { |
@@ -1001,9 +1009,6 @@ static int saa7134_alsa_init(void) | |||
1001 | } | 1009 | } |
1002 | } | 1010 | } |
1003 | 1011 | ||
1004 | dmasound_init = alsa_device_init; | ||
1005 | dmasound_exit = alsa_device_exit; | ||
1006 | |||
1007 | if (dev == NULL) | 1012 | if (dev == NULL) |
1008 | printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); | 1013 | printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); |
1009 | 1014 | ||
@@ -1023,12 +1028,15 @@ static void saa7134_alsa_exit(void) | |||
1023 | snd_card_free(snd_saa7134_cards[idx]); | 1028 | snd_card_free(snd_saa7134_cards[idx]); |
1024 | } | 1029 | } |
1025 | 1030 | ||
1031 | dmasound_init = NULL; | ||
1032 | dmasound_exit = NULL; | ||
1026 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); | 1033 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); |
1027 | 1034 | ||
1028 | return; | 1035 | return; |
1029 | } | 1036 | } |
1030 | 1037 | ||
1031 | module_init(saa7134_alsa_init); | 1038 | /* We initialize this late, to make sure the sound system is up and running */ |
1039 | late_initcall(saa7134_alsa_init); | ||
1032 | module_exit(saa7134_alsa_exit); | 1040 | module_exit(saa7134_alsa_exit); |
1033 | MODULE_LICENSE("GPL"); | 1041 | MODULE_LICENSE("GPL"); |
1034 | MODULE_AUTHOR("Ricardo Cerqueira"); | 1042 | MODULE_AUTHOR("Ricardo Cerqueira"); |