Exemplo n.º 1
0
static int __init alsa_seq_oss_init(void)
{
	int rc;

	if ((rc = register_device()) < 0)
		goto error;
	if ((rc = register_proc()) < 0) {
		unregister_device();
		goto error;
	}
	if ((rc = snd_seq_oss_create_client()) < 0) {
		unregister_proc();
		unregister_device();
		goto error;
	}

	rc = snd_seq_driver_register(&seq_oss_synth_driver);
	if (rc < 0) {
		snd_seq_oss_delete_client();
		unregister_proc();
		unregister_device();
		goto error;
	}

	/* success */
	snd_seq_oss_synth_init();

 error:
	return rc;
}
Exemplo n.º 2
0
static int __init alsa_seq_oss_init(void)
{
    int rc;
    static struct snd_seq_dev_ops ops = {
        snd_seq_oss_synth_register,
        snd_seq_oss_synth_unregister,
    };

    snd_seq_autoload_lock();
    if ((rc = register_device()) < 0)
        goto error;
    if ((rc = register_proc()) < 0) {
        unregister_device();
        goto error;
    }
    if ((rc = snd_seq_oss_create_client()) < 0) {
        unregister_proc();
        unregister_device();
        goto error;
    }

    if ((rc = snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OSS, &ops,
              sizeof(struct snd_seq_oss_reg))) < 0) {
        snd_seq_oss_delete_client();
        unregister_proc();
        unregister_device();
        goto error;
    }

    /* success */
    snd_seq_oss_synth_init();

error:
    snd_seq_autoload_unlock();
    return rc;
}