diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-11-20 08:03:48 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:29:14 -0500 |
commit | 2af677fc884fc6dc79e65c99050ea607ac8bab9b (patch) | |
tree | 4291d36c2f116d5887b88da5f0213b68933a1201 /sound/core/rawmidi.c | |
parent | a106cd3d9e88c8761bd0eac2ce402cc82bd11fea (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/rawmidi.c')
-rw-r--r-- | sound/core/rawmidi.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index d703545cae8a..7ac77e5ddcb1 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
@@ -1367,12 +1367,6 @@ static struct file_operations snd_rawmidi_f_ops = | |||
1367 | .compat_ioctl = snd_rawmidi_ioctl_compat, | 1367 | .compat_ioctl = snd_rawmidi_ioctl_compat, |
1368 | }; | 1368 | }; |
1369 | 1369 | ||
1370 | static struct snd_minor snd_rawmidi_reg = | ||
1371 | { | ||
1372 | .comment = "raw midi", | ||
1373 | .f_ops = &snd_rawmidi_f_ops, | ||
1374 | }; | ||
1375 | |||
1376 | static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi, | 1370 | static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi, |
1377 | struct snd_rawmidi_str *stream, | 1371 | struct snd_rawmidi_str *stream, |
1378 | int direction, | 1372 | int direction, |
@@ -1516,7 +1510,7 @@ static int snd_rawmidi_dev_register(struct snd_device *device) | |||
1516 | sprintf(name, "midiC%iD%i", rmidi->card->number, rmidi->device); | 1510 | sprintf(name, "midiC%iD%i", rmidi->card->number, rmidi->device); |
1517 | if ((err = snd_register_device(SNDRV_DEVICE_TYPE_RAWMIDI, | 1511 | if ((err = snd_register_device(SNDRV_DEVICE_TYPE_RAWMIDI, |
1518 | rmidi->card, rmidi->device, | 1512 | rmidi->card, rmidi->device, |
1519 | &snd_rawmidi_reg, name)) < 0) { | 1513 | &snd_rawmidi_f_ops, name)) < 0) { |
1520 | snd_printk(KERN_ERR "unable to register rawmidi device %i:%i\n", rmidi->card->number, rmidi->device); | 1514 | snd_printk(KERN_ERR "unable to register rawmidi device %i:%i\n", rmidi->card->number, rmidi->device); |
1521 | snd_rawmidi_devices[idx] = NULL; | 1515 | snd_rawmidi_devices[idx] = NULL; |
1522 | up(®ister_mutex); | 1516 | up(®ister_mutex); |
@@ -1533,7 +1527,8 @@ static int snd_rawmidi_dev_register(struct snd_device *device) | |||
1533 | rmidi->ossreg = 0; | 1527 | rmidi->ossreg = 0; |
1534 | if ((int)rmidi->device == midi_map[rmidi->card->number]) { | 1528 | if ((int)rmidi->device == midi_map[rmidi->card->number]) { |
1535 | if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, | 1529 | if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, |
1536 | rmidi->card, 0, &snd_rawmidi_reg, name) < 0) { | 1530 | rmidi->card, 0, |
1531 | &snd_rawmidi_f_ops, name) < 0) { | ||
1537 | snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 0); | 1532 | snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 0); |
1538 | } else { | 1533 | } else { |
1539 | rmidi->ossreg++; | 1534 | rmidi->ossreg++; |
@@ -1544,7 +1539,8 @@ static int snd_rawmidi_dev_register(struct snd_device *device) | |||
1544 | } | 1539 | } |
1545 | if ((int)rmidi->device == amidi_map[rmidi->card->number]) { | 1540 | if ((int)rmidi->device == amidi_map[rmidi->card->number]) { |
1546 | if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, | 1541 | if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, |
1547 | rmidi->card, 1, &snd_rawmidi_reg, name) < 0) { | 1542 | rmidi->card, 1, |
1543 | &snd_rawmidi_f_ops, name) < 0) { | ||
1548 | snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 1); | 1544 | snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 1); |
1549 | } else { | 1545 | } else { |
1550 | rmidi->ossreg++; | 1546 | rmidi->ossreg++; |