diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-02-12 08:20:24 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-02-12 08:42:31 -0500 |
commit | 54a721abd7953a58e5479065c0cfdd8679d785c9 (patch) | |
tree | 9b16bb0c1901cafb16cfd06f4f77a7bd08b8b0f2 /sound/core/seq | |
parent | 056622053b8ae02978678ac1321b5bd956e7c812 (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.c | 2 | ||||
-rw-r--r-- | sound/core/seq/seq_device.c | 19 | ||||
-rw-r--r-- | sound/core/seq/seq_dummy.c | 6 | ||||
-rw-r--r-- | sound/core/seq/seq_midi.c | 18 |
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 */ |
102 | static atomic_t snd_seq_in_init = ATOMIC_INIT(1); /* blocked as default */ | 102 | static atomic_t snd_seq_in_init = ATOMIC_INIT(1); /* blocked as default */ |
103 | void snd_seq_autoload_lock(void) | ||
104 | { | ||
105 | atomic_inc(&snd_seq_in_init); | ||
106 | } | ||
107 | EXPORT_SYMBOL(snd_seq_autoload_lock); | ||
108 | |||
109 | void snd_seq_autoload_unlock(void) | ||
110 | { | ||
111 | atomic_dec(&snd_seq_in_init); | ||
112 | } | ||
113 | EXPORT_SYMBOL(snd_seq_autoload_unlock); | ||
114 | 103 | ||
115 | static int request_seq_drv(struct device *dev, void *data) | 104 | static int request_seq_drv(struct device *dev, void *data) |
116 | { | 105 | { |
@@ -147,6 +136,12 @@ void snd_seq_autoload_init(void) | |||
147 | } | 136 | } |
148 | EXPORT_SYMBOL(snd_seq_autoload_init); | 137 | EXPORT_SYMBOL(snd_seq_autoload_init); |
149 | 138 | ||
139 | void snd_seq_autoload_exit(void) | ||
140 | { | ||
141 | atomic_inc(&snd_seq_in_init); | ||
142 | } | ||
143 | EXPORT_SYMBOL(snd_seq_autoload_exit); | ||
144 | |||
150 | void snd_seq_device_load_drivers(void) | 145 | void 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 | ||
215 | static int __init alsa_seq_dummy_init(void) | 215 | static 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 | ||
224 | static void __exit alsa_seq_dummy_exit(void) | 220 | static 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 | ||
472 | static int __init alsa_seq_midi_init(void) | 472 | module_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 | |||
482 | static void __exit alsa_seq_midi_exit(void) | ||
483 | { | ||
484 | snd_seq_driver_unregister(&seq_midisynth_driver); | ||
485 | } | ||
486 | |||
487 | module_init(alsa_seq_midi_init) | ||
488 | module_exit(alsa_seq_midi_exit) | ||