aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-10-15 08:09:42 -0400
committerTakashi Iwai <tiwai@suse.de>2014-10-18 14:25:19 -0400
commitd5129f33a0d155d69cb0652cfc87bbc4d132ca17 (patch)
tree3424906118af81274dad34028ed675d609b1be3c /sound/core
parent68ab61084de3220e2fb0a698c890ba91decddc85 (diff)
Subject: ALSA: seq: Remove autoload locks in driver registration
Since we're calling request_module() asynchronously now, we can get rid of the autoload lock in snd_seq_device_register_driver(), as well as in the snd-seq driver registration itself. This enables the automatic loading of dependent sequencer modules, such as snd-seq-virmidi from snd-emu10k1-synth. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/seq/seq.c2
-rw-r--r--sound/core/seq/seq_device.c7
2 files changed, 1 insertions, 8 deletions
diff --git a/sound/core/seq/seq.c b/sound/core/seq/seq.c
index bebdd2e920ca..7e0aabb808a6 100644
--- a/sound/core/seq/seq.c
+++ b/sound/core/seq/seq.c
@@ -86,7 +86,6 @@ static int __init alsa_seq_init(void)
86{ 86{
87 int err; 87 int err;
88 88
89 snd_seq_autoload_lock();
90 if ((err = client_init_data()) < 0) 89 if ((err = client_init_data()) < 0)
91 goto error; 90 goto error;
92 91
@@ -112,7 +111,6 @@ static int __init alsa_seq_init(void)
112 111
113 snd_seq_autoload_init(); 112 snd_seq_autoload_init();
114 error: 113 error:
115 snd_seq_autoload_unlock();
116 return err; 114 return err;
117} 115}
118 116
diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
index a8e2c6016800..0631bdadd12b 100644
--- a/sound/core/seq/seq_device.c
+++ b/sound/core/seq/seq_device.c
@@ -360,16 +360,12 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry,
360 entry->init_device == NULL || entry->free_device == NULL) 360 entry->init_device == NULL || entry->free_device == NULL)
361 return -EINVAL; 361 return -EINVAL;
362 362
363 snd_seq_autoload_lock();
364 ops = find_driver(id, 1); 363 ops = find_driver(id, 1);
365 if (ops == NULL) { 364 if (ops == NULL)
366 snd_seq_autoload_unlock();
367 return -ENOMEM; 365 return -ENOMEM;
368 }
369 if (ops->driver & DRIVER_LOADED) { 366 if (ops->driver & DRIVER_LOADED) {
370 pr_warn("ALSA: seq: driver_register: driver '%s' already exists\n", id); 367 pr_warn("ALSA: seq: driver_register: driver '%s' already exists\n", id);
371 unlock_driver(ops); 368 unlock_driver(ops);
372 snd_seq_autoload_unlock();
373 return -EBUSY; 369 return -EBUSY;
374 } 370 }
375 371
@@ -386,7 +382,6 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry,
386 mutex_unlock(&ops->reg_mutex); 382 mutex_unlock(&ops->reg_mutex);
387 383
388 unlock_driver(ops); 384 unlock_driver(ops);
389 snd_seq_autoload_unlock();
390 385
391 return 0; 386 return 0;
392} 387}