]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - sound/core/sound.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / sound / core / sound.c
index 66691fe437e63315fad4a1af8c073e9fbba058e5..1c7a3efe17782b3f4a830efdc815f333b2aee3d6 100644 (file)
@@ -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])