.compat_ioctl = snd_seq_ioctl_compat,
};
+static struct device seq_dev;
+
/*
* register sequencer device
*/
{
int err;
+ snd_device_initialize(&seq_dev, NULL);
+ dev_set_name(&seq_dev, "seq");
+
if (mutex_lock_interruptible(®ister_mutex))
return -ERESTARTSYS;
- if ((err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0,
- &snd_seq_f_ops, NULL, "seq")) < 0) {
+ err = snd_register_device_for_dev(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0,
+ &snd_seq_f_ops, NULL,
+ &seq_dev, NULL, NULL);
+ if (err < 0) {
mutex_unlock(®ister_mutex);
+ put_device(&seq_dev);
return err;
}
void __exit snd_sequencer_device_done(void)
{
snd_unregister_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0);
+ put_device(&seq_dev);
}