diff options
Diffstat (limited to 'sound/core/rawmidi.c')
-rw-r--r-- | sound/core/rawmidi.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index 7c20eafecb8..d033e61c05c 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
@@ -378,24 +378,20 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file) | |||
378 | struct list_head *list; | 378 | struct list_head *list; |
379 | snd_ctl_file_t *kctl; | 379 | snd_ctl_file_t *kctl; |
380 | 380 | ||
381 | switch (maj) { | 381 | if (maj == snd_major) { |
382 | case CONFIG_SND_MAJOR: | ||
383 | cardnum = SNDRV_MINOR_CARD(iminor(inode)); | 382 | cardnum = SNDRV_MINOR_CARD(iminor(inode)); |
384 | cardnum %= SNDRV_CARDS; | 383 | cardnum %= SNDRV_CARDS; |
385 | device = SNDRV_MINOR_DEVICE(iminor(inode)) - SNDRV_MINOR_RAWMIDI; | 384 | device = SNDRV_MINOR_DEVICE(iminor(inode)) - SNDRV_MINOR_RAWMIDI; |
386 | device %= SNDRV_MINOR_RAWMIDIS; | 385 | device %= SNDRV_MINOR_RAWMIDIS; |
387 | break; | ||
388 | #ifdef CONFIG_SND_OSSEMUL | 386 | #ifdef CONFIG_SND_OSSEMUL |
389 | case SOUND_MAJOR: | 387 | } else if (maj == SOUND_MAJOR) { |
390 | cardnum = SNDRV_MINOR_OSS_CARD(iminor(inode)); | 388 | cardnum = SNDRV_MINOR_OSS_CARD(iminor(inode)); |
391 | cardnum %= SNDRV_CARDS; | 389 | cardnum %= SNDRV_CARDS; |
392 | device = SNDRV_MINOR_OSS_DEVICE(iminor(inode)) == SNDRV_MINOR_OSS_MIDI ? | 390 | device = SNDRV_MINOR_OSS_DEVICE(iminor(inode)) == SNDRV_MINOR_OSS_MIDI ? |
393 | midi_map[cardnum] : amidi_map[cardnum]; | 391 | midi_map[cardnum] : amidi_map[cardnum]; |
394 | break; | ||
395 | #endif | 392 | #endif |
396 | default: | 393 | } else |
397 | return -ENXIO; | 394 | return -ENXIO; |
398 | } | ||
399 | 395 | ||
400 | rmidi = snd_rawmidi_devices[(cardnum * SNDRV_RAWMIDI_DEVICES) + device]; | 396 | rmidi = snd_rawmidi_devices[(cardnum * SNDRV_RAWMIDI_DEVICES) + device]; |
401 | if (rmidi == NULL) | 397 | if (rmidi == NULL) |
@@ -411,7 +407,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file) | |||
411 | if (err < 0) | 407 | if (err < 0) |
412 | return -ENODEV; | 408 | return -ENODEV; |
413 | fflags = snd_rawmidi_file_flags(file); | 409 | fflags = snd_rawmidi_file_flags(file); |
414 | if ((file->f_flags & O_APPEND) || maj != CONFIG_SND_MAJOR) /* OSS emul? */ | 410 | if ((file->f_flags & O_APPEND) || maj == SOUND_MAJOR) /* OSS emul? */ |
415 | fflags |= SNDRV_RAWMIDI_LFLG_APPEND; | 411 | fflags |= SNDRV_RAWMIDI_LFLG_APPEND; |
416 | fflags |= SNDRV_RAWMIDI_LFLG_NOOPENLOCK; | 412 | fflags |= SNDRV_RAWMIDI_LFLG_NOOPENLOCK; |
417 | rawmidi_file = kmalloc(sizeof(*rawmidi_file), GFP_KERNEL); | 413 | rawmidi_file = kmalloc(sizeof(*rawmidi_file), GFP_KERNEL); |