From 2af677fc884fc6dc79e65c99050ea607ac8bab9b Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Sun, 20 Nov 2005 14:03:48 +0100 Subject: [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 --- sound/core/seq/oss/seq_oss.c | 9 ++------- sound/core/seq/seq_clientmgr.c | 10 ++-------- 2 files changed, 4 insertions(+), 15 deletions(-) (limited to 'sound/core/seq') diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c index 2371e41b13ef..61c0a41376fd 100644 --- a/sound/core/seq/oss/seq_oss.c +++ b/sound/core/seq/oss/seq_oss.c @@ -217,11 +217,6 @@ static struct file_operations seq_oss_f_ops = .compat_ioctl = odev_ioctl_compat, }; -static struct snd_minor seq_oss_reg = { - .comment = "sequencer", - .f_ops = &seq_oss_f_ops, -}; - static int __init register_device(void) { @@ -230,7 +225,7 @@ register_device(void) down(®ister_mutex); if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0, - &seq_oss_reg, + &seq_oss_f_ops, SNDRV_SEQ_OSS_DEVNAME)) < 0) { snd_printk(KERN_ERR "can't register device seq\n"); up(®ister_mutex); @@ -238,7 +233,7 @@ register_device(void) } if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, NULL, 0, - &seq_oss_reg, + &seq_oss_f_ops, SNDRV_SEQ_OSS_DEVNAME)) < 0) { snd_printk(KERN_ERR "can't register device music\n"); snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0); diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index 5eab4201c640..087fdf32732b 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c @@ -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; } -- cgit v1.2.3