aboutsummaryrefslogtreecommitdiff
path: root/sound/core/rawmidi.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-11-20 14:03:48 +0100
committerJaroslav Kysela <perex@suse.cz>2006-01-03 12:29:14 +0100
commit2af677fc884fc6dc79e65c99050ea607ac8bab9b (patch)
tree4291d36c2f116d5887b88da5f0213b68933a1201 /sound/core/rawmidi.c
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/rawmidi.c')
-rw-r--r--sound/core/rawmidi.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index d703545cae8..7ac77e5ddcb 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -1367,12 +1367,6 @@ static struct file_operations snd_rawmidi_f_ops =
.compat_ioctl = snd_rawmidi_ioctl_compat,
};
-static struct snd_minor snd_rawmidi_reg =
-{
- .comment = "raw midi",
- .f_ops = &snd_rawmidi_f_ops,
-};
-
static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi,
struct snd_rawmidi_str *stream,
int direction,
@@ -1516,7 +1510,7 @@ static int snd_rawmidi_dev_register(struct snd_device *device)
sprintf(name, "midiC%iD%i", rmidi->card->number, rmidi->device);
if ((err = snd_register_device(SNDRV_DEVICE_TYPE_RAWMIDI,
rmidi->card, rmidi->device,
- &snd_rawmidi_reg, name)) < 0) {
+ &snd_rawmidi_f_ops, name)) < 0) {
snd_printk(KERN_ERR "unable to register rawmidi device %i:%i\n", rmidi->card->number, rmidi->device);
snd_rawmidi_devices[idx] = NULL;
up(&register_mutex);
@@ -1533,7 +1527,8 @@ static int snd_rawmidi_dev_register(struct snd_device *device)
rmidi->ossreg = 0;
if ((int)rmidi->device == midi_map[rmidi->card->number]) {
if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI,
- rmidi->card, 0, &snd_rawmidi_reg, name) < 0) {
+ rmidi->card, 0,
+ &snd_rawmidi_f_ops, name) < 0) {
snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 0);
} else {
rmidi->ossreg++;
@@ -1544,7 +1539,8 @@ static int snd_rawmidi_dev_register(struct snd_device *device)
}
if ((int)rmidi->device == amidi_map[rmidi->card->number]) {
if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI,
- rmidi->card, 1, &snd_rawmidi_reg, name) < 0) {
+ rmidi->card, 1,
+ &snd_rawmidi_f_ops, name) < 0) {
snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 1);
} else {
rmidi->ossreg++;