diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-01-13 08:37:14 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-01-13 08:37:14 +0100 |
commit | e38302f78284e3e80ffc2eef54001fce7d183bd4 (patch) | |
tree | 0cb61d52ca9d11d446e3fc1bc97d8fd92ab1e934 /sound/core/sound.c | |
parent | 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 (diff) | |
parent | c386735264da97e6b6d15aa56361e9ef188b26ab (diff) |
Merge branch 'topic/misc' into for-linus
Diffstat (limited to 'sound/core/sound.c')
-rw-r--r-- | sound/core/sound.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sound/core/sound.c b/sound/core/sound.c index 66691fe437e6..1c7a3efe1778 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c @@ -188,14 +188,22 @@ static const struct file_operations snd_fops = }; #ifdef CONFIG_SND_DYNAMIC_MINORS -static int snd_find_free_minor(void) +static int snd_find_free_minor(int type) { int minor; + /* static minors for module auto loading */ + if (type == SNDRV_DEVICE_TYPE_SEQUENCER) + return SNDRV_MINOR_SEQUENCER; + if (type == SNDRV_DEVICE_TYPE_TIMER) + return SNDRV_MINOR_TIMER; + for (minor = 0; minor < ARRAY_SIZE(snd_minors); ++minor) { - /* skip minors still used statically for autoloading devices */ - if (SNDRV_MINOR_DEVICE(minor) == SNDRV_MINOR_CONTROL || - minor == SNDRV_MINOR_SEQUENCER) + /* skip static minors still used for module auto loading */ + if (SNDRV_MINOR_DEVICE(minor) == SNDRV_MINOR_CONTROL) + continue; + if (minor == SNDRV_MINOR_SEQUENCER || + minor == SNDRV_MINOR_TIMER) continue; if (!snd_minors[minor]) return minor; @@ -269,7 +277,7 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev, preg->private_data = private_data; mutex_lock(&sound_mutex); #ifdef CONFIG_SND_DYNAMIC_MINORS - minor = snd_find_free_minor(); + minor = snd_find_free_minor(type); #else minor = snd_kernel_minor(type, card, dev); if (minor >= 0 && snd_minors[minor]) |