summaryrefslogtreecommitdiff
path: root/sound/core/rawmidi.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-10-24 19:05:03 +0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 15:20:08 +0300
commitf1902860161ff212c515e7ea629e880fec856a37 (patch)
treec3dc4d5ca38c05f15f06a6583594f7b54dad4c66 /sound/core/rawmidi.c
parentc8a7e5c40ddcf98f1026581e411b05ff86491907 (diff)
downloadlinux-f1902860161ff212c515e7ea629e880fec856a37.tar.xz
[ALSA] fix improper CONFIG_SND_MAJOR usage
Modules: HWDEP Midlevel,PCM Midlevel,RawMidi Midlevel,ALSA Core Replace usage of CONFIG_SND_MAJOR with snd_major, where appropriate. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/core/rawmidi.c')
-rw-r--r--sound/core/rawmidi.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 7c20eafecb8a..d033e61c05c7 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)
struct list_head *list;
snd_ctl_file_t *kctl;
- switch (maj) {
- case CONFIG_SND_MAJOR:
+ if (maj == snd_major) {
cardnum = SNDRV_MINOR_CARD(iminor(inode));
cardnum %= SNDRV_CARDS;
device = SNDRV_MINOR_DEVICE(iminor(inode)) - SNDRV_MINOR_RAWMIDI;
device %= SNDRV_MINOR_RAWMIDIS;
- break;
#ifdef CONFIG_SND_OSSEMUL
- case SOUND_MAJOR:
+ } else if (maj == SOUND_MAJOR) {
cardnum = SNDRV_MINOR_OSS_CARD(iminor(inode));
cardnum %= SNDRV_CARDS;
device = SNDRV_MINOR_OSS_DEVICE(iminor(inode)) == SNDRV_MINOR_OSS_MIDI ?
midi_map[cardnum] : amidi_map[cardnum];
- break;
#endif
- default:
+ } else
return -ENXIO;
- }
rmidi = snd_rawmidi_devices[(cardnum * SNDRV_RAWMIDI_DEVICES) + device];
if (rmidi == NULL)
@@ -411,7 +407,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file)
if (err < 0)
return -ENODEV;
fflags = snd_rawmidi_file_flags(file);
- if ((file->f_flags & O_APPEND) || maj != CONFIG_SND_MAJOR) /* OSS emul? */
+ if ((file->f_flags & O_APPEND) || maj == SOUND_MAJOR) /* OSS emul? */
fflags |= SNDRV_RAWMIDI_LFLG_APPEND;
fflags |= SNDRV_RAWMIDI_LFLG_NOOPENLOCK;
rawmidi_file = kmalloc(sizeof(*rawmidi_file), GFP_KERNEL);