提交 d5129f33 编写于 作者: T Takashi Iwai

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: NTakashi Iwai <tiwai@suse.de>
上级 68ab6108
...@@ -86,7 +86,6 @@ static int __init alsa_seq_init(void) ...@@ -86,7 +86,6 @@ static int __init alsa_seq_init(void)
{ {
int err; int err;
snd_seq_autoload_lock();
if ((err = client_init_data()) < 0) if ((err = client_init_data()) < 0)
goto error; goto error;
...@@ -112,7 +111,6 @@ static int __init alsa_seq_init(void) ...@@ -112,7 +111,6 @@ static int __init alsa_seq_init(void)
snd_seq_autoload_init(); snd_seq_autoload_init();
error: error:
snd_seq_autoload_unlock();
return err; return err;
} }
......
...@@ -360,16 +360,12 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry, ...@@ -360,16 +360,12 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry,
entry->init_device == NULL || entry->free_device == NULL) entry->init_device == NULL || entry->free_device == NULL)
return -EINVAL; return -EINVAL;
snd_seq_autoload_lock();
ops = find_driver(id, 1); ops = find_driver(id, 1);
if (ops == NULL) { if (ops == NULL)
snd_seq_autoload_unlock();
return -ENOMEM; return -ENOMEM;
}
if (ops->driver & DRIVER_LOADED) { if (ops->driver & DRIVER_LOADED) {
pr_warn("ALSA: seq: driver_register: driver '%s' already exists\n", id); pr_warn("ALSA: seq: driver_register: driver '%s' already exists\n", id);
unlock_driver(ops); unlock_driver(ops);
snd_seq_autoload_unlock();
return -EBUSY; return -EBUSY;
} }
...@@ -386,7 +382,6 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry, ...@@ -386,7 +382,6 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry,
mutex_unlock(&ops->reg_mutex); mutex_unlock(&ops->reg_mutex);
unlock_driver(ops); unlock_driver(ops);
snd_seq_autoload_unlock();
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册