int snd_seq_event_port_detach(int client, int port);
#ifdef CONFIG_MODULES
-void snd_seq_autoload_lock(void);
-void snd_seq_autoload_unlock(void);
void snd_seq_autoload_init(void);
-#define snd_seq_autoload_exit() snd_seq_autoload_lock()
+void snd_seq_autoload_exit(void);
#else
-#define snd_seq_autoload_lock()
-#define snd_seq_autoload_unlock()
#define snd_seq_autoload_init()
#define snd_seq_autoload_exit()
#endif
{
int rc;
- snd_seq_autoload_lock();
if ((rc = register_device()) < 0)
goto error;
if ((rc = register_proc()) < 0) {
snd_seq_oss_synth_init();
error:
- snd_seq_autoload_unlock();
return rc;
}
*/
#ifdef CONFIG_MODULES
-/* avoid auto-loading during module_init() */
+/* flag to block auto-loading */
static atomic_t snd_seq_in_init = ATOMIC_INIT(1); /* blocked as default */
-void snd_seq_autoload_lock(void)
-{
- atomic_inc(&snd_seq_in_init);
-}
-EXPORT_SYMBOL(snd_seq_autoload_lock);
-
-void snd_seq_autoload_unlock(void)
-{
- atomic_dec(&snd_seq_in_init);
-}
-EXPORT_SYMBOL(snd_seq_autoload_unlock);
static int request_seq_drv(struct device *dev, void *data)
{
}
EXPORT_SYMBOL(snd_seq_autoload_init);
+void snd_seq_autoload_exit(void)
+{
+ atomic_inc(&snd_seq_in_init);
+}
+EXPORT_SYMBOL(snd_seq_autoload_exit);
+
void snd_seq_device_load_drivers(void)
{
queue_autoload_drivers();
static int __init alsa_seq_dummy_init(void)
{
- int err;
- snd_seq_autoload_lock();
- err = register_client();
- snd_seq_autoload_unlock();
- return err;
+ return register_client();
}
static void __exit alsa_seq_dummy_exit(void)
.argsize = 0,
};
-static int __init alsa_seq_midi_init(void)
-{
- int err;
-
- snd_seq_autoload_lock();
- err = snd_seq_driver_register(&seq_midisynth_driver);
- snd_seq_autoload_unlock();
- return err;
-}
-
-static void __exit alsa_seq_midi_exit(void)
-{
- snd_seq_driver_unregister(&seq_midisynth_driver);
-}
-
-module_init(alsa_seq_midi_init)
-module_exit(alsa_seq_midi_exit)
+module_snd_seq_driver(seq_midisynth_driver);