aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/seq
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-11-20 08:03:48 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:29:14 -0500
commit2af677fc884fc6dc79e65c99050ea607ac8bab9b (patch)
tree4291d36c2f116d5887b88da5f0213b68933a1201 /sound/core/seq
parenta106cd3d9e88c8761bd0eac2ce402cc82bd11fea (diff)
[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>
Diffstat (limited to 'sound/core/seq')
-rw-r--r--sound/core/seq/oss/seq_oss.c9
-rw-r--r--sound/core/seq/seq_clientmgr.c10
2 files changed, 4 insertions, 15 deletions
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 =
217 .compat_ioctl = odev_ioctl_compat, 217 .compat_ioctl = odev_ioctl_compat,
218}; 218};
219 219
220static struct snd_minor seq_oss_reg = {
221 .comment = "sequencer",
222 .f_ops = &seq_oss_f_ops,
223};
224
225static int __init 220static int __init
226register_device(void) 221register_device(void)
227{ 222{
@@ -230,7 +225,7 @@ register_device(void)
230 down(&register_mutex); 225 down(&register_mutex);
231 if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, 226 if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER,
232 NULL, 0, 227 NULL, 0,
233 &seq_oss_reg, 228 &seq_oss_f_ops,
234 SNDRV_SEQ_OSS_DEVNAME)) < 0) { 229 SNDRV_SEQ_OSS_DEVNAME)) < 0) {
235 snd_printk(KERN_ERR "can't register device seq\n"); 230 snd_printk(KERN_ERR "can't register device seq\n");
236 up(&register_mutex); 231 up(&register_mutex);
@@ -238,7 +233,7 @@ register_device(void)
238 } 233 }
239 if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, 234 if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC,
240 NULL, 0, 235 NULL, 0,
241 &seq_oss_reg, 236 &seq_oss_f_ops,
242 SNDRV_SEQ_OSS_DEVNAME)) < 0) { 237 SNDRV_SEQ_OSS_DEVNAME)) < 0) {
243 snd_printk(KERN_ERR "can't register device music\n"); 238 snd_printk(KERN_ERR "can't register device music\n");
244 snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0); 239 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 =
2520 .compat_ioctl = snd_seq_ioctl_compat, 2520 .compat_ioctl = snd_seq_ioctl_compat,
2521}; 2521};
2522 2522
2523static struct snd_minor snd_seq_reg =
2524{
2525 .comment = "sequencer",
2526 .f_ops = &snd_seq_f_ops,
2527};
2528
2529
2530/* 2523/*
2531 * register sequencer device 2524 * register sequencer device
2532 */ 2525 */
@@ -2537,7 +2530,8 @@ int __init snd_sequencer_device_init(void)
2537 if (down_interruptible(&register_mutex)) 2530 if (down_interruptible(&register_mutex))
2538 return -ERESTARTSYS; 2531 return -ERESTARTSYS;
2539 2532
2540 if ((err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0, &snd_seq_reg, "seq")) < 0) { 2533 if ((err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0,
2534 &snd_seq_f_ops, "seq")) < 0) {
2541 up(&register_mutex); 2535 up(&register_mutex);
2542 return err; 2536 return err;
2543 } 2537 }