aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-10-24 11:05:03 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:20:08 -0500
commitf1902860161ff212c515e7ea629e880fec856a37 (patch)
treec3dc4d5ca38c05f15f06a6583594f7b54dad4c66
parentc8a7e5c40ddcf98f1026581e411b05ff86491907 (diff)
[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>
-rw-r--r--include/sound/core.h1
-rw-r--r--sound/core/hwdep.c10
-rw-r--r--sound/core/pcm_native.c1
-rw-r--r--sound/core/rawmidi.c12
4 files changed, 8 insertions, 16 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index 642ddfbc6325..2be65ad2fd83 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -255,6 +255,7 @@ typedef struct _snd_minor snd_minor_t;
255 255
256/* sound.c */ 256/* sound.c */
257 257
258extern int snd_major;
258extern int snd_ecards_limit; 259extern int snd_ecards_limit;
259 260
260void snd_request_card(int card); 261void snd_request_card(int card);
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index 9383f1294fb5..e91cee35a4b9 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -81,20 +81,16 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
81 int err; 81 int err;
82 wait_queue_t wait; 82 wait_queue_t wait;
83 83
84 switch (major) { 84 if (major == snd_major) {
85 case CONFIG_SND_MAJOR:
86 cardnum = SNDRV_MINOR_CARD(iminor(inode)); 85 cardnum = SNDRV_MINOR_CARD(iminor(inode));
87 device = SNDRV_MINOR_DEVICE(iminor(inode)) - SNDRV_MINOR_HWDEP; 86 device = SNDRV_MINOR_DEVICE(iminor(inode)) - SNDRV_MINOR_HWDEP;
88 break;
89#ifdef CONFIG_SND_OSSEMUL 87#ifdef CONFIG_SND_OSSEMUL
90 case SOUND_MAJOR: 88 } else if (major == SOUND_MAJOR) {
91 cardnum = SNDRV_MINOR_OSS_CARD(iminor(inode)); 89 cardnum = SNDRV_MINOR_OSS_CARD(iminor(inode));
92 device = 0; 90 device = 0;
93 break;
94#endif 91#endif
95 default: 92 } else
96 return -ENXIO; 93 return -ENXIO;
97 }
98 cardnum %= SNDRV_CARDS; 94 cardnum %= SNDRV_CARDS;
99 device %= SNDRV_MINOR_HWDEPS; 95 device %= SNDRV_MINOR_HWDEPS;
100 hw = snd_hwdep_devices[(cardnum * SNDRV_MINOR_HWDEPS) + device]; 96 hw = snd_hwdep_devices[(cardnum * SNDRV_MINOR_HWDEPS) + device];
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index a1924f12d8fc..16e252f54954 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1522,7 +1522,6 @@ static int snd_pcm_drop(snd_pcm_substream_t *substream)
1522 1522
1523 1523
1524/* WARNING: Don't forget to fput back the file */ 1524/* WARNING: Don't forget to fput back the file */
1525extern int snd_major;
1526static struct file *snd_pcm_file_fd(int fd) 1525static struct file *snd_pcm_file_fd(int fd)
1527{ 1526{
1528 struct file *file; 1527 struct file *file;
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)
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);