[ALSA] dynamic minors (1/6): store device type in struct snd_minor
Instead of a comment string, store the device type in the snd_minor structure. This makes snd_minor more flexible, and has the nice side effect that we don't need anymore to create a separate snd_minor template for registering a device but can pass the file_operations directly to snd_register_device(). Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
This commit is contained in:
committed by
Jaroslav Kysela
parent
a106cd3d9e
commit
2af677fc88
@@ -2520,13 +2520,6 @@ static struct file_operations snd_seq_f_ops =
|
||||
.compat_ioctl = snd_seq_ioctl_compat,
|
||||
};
|
||||
|
||||
static struct snd_minor snd_seq_reg =
|
||||
{
|
||||
.comment = "sequencer",
|
||||
.f_ops = &snd_seq_f_ops,
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* register sequencer device
|
||||
*/
|
||||
@@ -2537,7 +2530,8 @@ int __init snd_sequencer_device_init(void)
|
||||
if (down_interruptible(®ister_mutex))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
if ((err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0, &snd_seq_reg, "seq")) < 0) {
|
||||
if ((err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0,
|
||||
&snd_seq_f_ops, "seq")) < 0) {
|
||||
up(®ister_mutex);
|
||||
return err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user