aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/seq
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-02-12 08:20:24 -0500
committerTakashi Iwai <tiwai@suse.de>2015-02-12 08:42:31 -0500
commit54a721abd7953a58e5479065c0cfdd8679d785c9 (patch)
tree9b16bb0c1901cafb16cfd06f4f77a7bd08b8b0f2 /sound/core/seq
parent056622053b8ae02978678ac1321b5bd956e7c812 (diff)
ALSA: seq: Drop snd_seq_autoload_lock() and _unlock()
The autoload lock became already superfluous due to the recent rework of autoload code. Let's drop them now. This allows us to simplify a few codes nicely. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq')
-rw-r--r--sound/core/seq/oss/seq_oss.c2
-rw-r--r--sound/core/seq/seq_device.c19
-rw-r--r--sound/core/seq/seq_dummy.c6
-rw-r--r--sound/core/seq/seq_midi.c18
4 files changed, 9 insertions, 36 deletions
diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c
index ae1814aa767e..72873a46afeb 100644
--- a/sound/core/seq/oss/seq_oss.c
+++ b/sound/core/seq/oss/seq_oss.c
@@ -79,7 +79,6 @@ static int __init alsa_seq_oss_init(void)
79{ 79{
80 int rc; 80 int rc;
81 81
82 snd_seq_autoload_lock();
83 if ((rc = register_device()) < 0) 82 if ((rc = register_device()) < 0)
84 goto error; 83 goto error;
85 if ((rc = register_proc()) < 0) { 84 if ((rc = register_proc()) < 0) {
@@ -104,7 +103,6 @@ static int __init alsa_seq_oss_init(void)
104 snd_seq_oss_synth_init(); 103 snd_seq_oss_synth_init();
105 104
106 error: 105 error:
107 snd_seq_autoload_unlock();
108 return rc; 106 return rc;
109} 107}
110 108
diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
index 48b20f009598..355b34269bd1 100644
--- a/sound/core/seq/seq_device.c
+++ b/sound/core/seq/seq_device.c
@@ -98,19 +98,8 @@ static void snd_seq_device_info(struct snd_info_entry *entry,
98 */ 98 */
99 99
100#ifdef CONFIG_MODULES 100#ifdef CONFIG_MODULES
101/* avoid auto-loading during module_init() */ 101/* flag to block auto-loading */
102static atomic_t snd_seq_in_init = ATOMIC_INIT(1); /* blocked as default */ 102static atomic_t snd_seq_in_init = ATOMIC_INIT(1); /* blocked as default */
103void snd_seq_autoload_lock(void)
104{
105 atomic_inc(&snd_seq_in_init);
106}
107EXPORT_SYMBOL(snd_seq_autoload_lock);
108
109void snd_seq_autoload_unlock(void)
110{
111 atomic_dec(&snd_seq_in_init);
112}
113EXPORT_SYMBOL(snd_seq_autoload_unlock);
114 103
115static int request_seq_drv(struct device *dev, void *data) 104static int request_seq_drv(struct device *dev, void *data)
116{ 105{
@@ -147,6 +136,12 @@ void snd_seq_autoload_init(void)
147} 136}
148EXPORT_SYMBOL(snd_seq_autoload_init); 137EXPORT_SYMBOL(snd_seq_autoload_init);
149 138
139void snd_seq_autoload_exit(void)
140{
141 atomic_inc(&snd_seq_in_init);
142}
143EXPORT_SYMBOL(snd_seq_autoload_exit);
144
150void snd_seq_device_load_drivers(void) 145void snd_seq_device_load_drivers(void)
151{ 146{
152 queue_autoload_drivers(); 147 queue_autoload_drivers();
diff --git a/sound/core/seq/seq_dummy.c b/sound/core/seq/seq_dummy.c
index 5d905d90d504..d3a2ec4f0561 100644
--- a/sound/core/seq/seq_dummy.c
+++ b/sound/core/seq/seq_dummy.c
@@ -214,11 +214,7 @@ delete_client(void)
214 214
215static int __init alsa_seq_dummy_init(void) 215static int __init alsa_seq_dummy_init(void)
216{ 216{
217 int err; 217 return register_client();
218 snd_seq_autoload_lock();
219 err = register_client();
220 snd_seq_autoload_unlock();
221 return err;
222} 218}
223 219
224static void __exit alsa_seq_dummy_exit(void) 220static void __exit alsa_seq_dummy_exit(void)
diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c
index 79c73119cedc..5dd0ee258359 100644
--- a/sound/core/seq/seq_midi.c
+++ b/sound/core/seq/seq_midi.c
@@ -469,20 +469,4 @@ static struct snd_seq_driver seq_midisynth_driver = {
469 .argsize = 0, 469 .argsize = 0,
470}; 470};
471 471
472static int __init alsa_seq_midi_init(void) 472module_snd_seq_driver(seq_midisynth_driver);
473{
474 int err;
475
476 snd_seq_autoload_lock();
477 err = snd_seq_driver_register(&seq_midisynth_driver);
478 snd_seq_autoload_unlock();
479 return err;
480}
481
482static void __exit alsa_seq_midi_exit(void)
483{
484 snd_seq_driver_unregister(&seq_midisynth_driver);
485}
486
487module_init(alsa_seq_midi_init)
488module_exit(alsa_seq_midi_exit)