Loading sound/core/sound.c +5 −9 Original line number Original line Diff line number Diff line Loading @@ -186,7 +186,7 @@ static const struct file_operations snd_fops = }; }; #ifdef CONFIG_SND_DYNAMIC_MINORS #ifdef CONFIG_SND_DYNAMIC_MINORS static int snd_find_free_minor(int type) static int snd_find_free_minor(int type, struct snd_card *card, int dev) { { int minor; int minor; Loading @@ -209,7 +209,7 @@ static int snd_find_free_minor(int type) return -EBUSY; return -EBUSY; } } #else #else static int snd_kernel_minor(int type, struct snd_card *card, int dev) static int snd_find_free_minor(int type, struct snd_card *card, int dev) { { int minor; int minor; Loading Loading @@ -237,6 +237,8 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev) } } if (snd_BUG_ON(minor < 0 || minor >= SNDRV_OS_MINORS)) if (snd_BUG_ON(minor < 0 || minor >= SNDRV_OS_MINORS)) return -EINVAL; return -EINVAL; if (snd_minors[minor]) return -EBUSY; return minor; return minor; } } #endif #endif Loading Loading @@ -276,13 +278,7 @@ int snd_register_device(int type, struct snd_card *card, int dev, preg->private_data = private_data; preg->private_data = private_data; preg->card_ptr = card; preg->card_ptr = card; mutex_lock(&sound_mutex); mutex_lock(&sound_mutex); #ifdef CONFIG_SND_DYNAMIC_MINORS minor = snd_find_free_minor(type, card, dev); minor = snd_find_free_minor(type); #else minor = snd_kernel_minor(type, card, dev); if (minor >= 0 && snd_minors[minor]) minor = -EBUSY; #endif if (minor < 0) { if (minor < 0) { err = minor; err = minor; goto error; goto error; Loading Loading
sound/core/sound.c +5 −9 Original line number Original line Diff line number Diff line Loading @@ -186,7 +186,7 @@ static const struct file_operations snd_fops = }; }; #ifdef CONFIG_SND_DYNAMIC_MINORS #ifdef CONFIG_SND_DYNAMIC_MINORS static int snd_find_free_minor(int type) static int snd_find_free_minor(int type, struct snd_card *card, int dev) { { int minor; int minor; Loading @@ -209,7 +209,7 @@ static int snd_find_free_minor(int type) return -EBUSY; return -EBUSY; } } #else #else static int snd_kernel_minor(int type, struct snd_card *card, int dev) static int snd_find_free_minor(int type, struct snd_card *card, int dev) { { int minor; int minor; Loading Loading @@ -237,6 +237,8 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev) } } if (snd_BUG_ON(minor < 0 || minor >= SNDRV_OS_MINORS)) if (snd_BUG_ON(minor < 0 || minor >= SNDRV_OS_MINORS)) return -EINVAL; return -EINVAL; if (snd_minors[minor]) return -EBUSY; return minor; return minor; } } #endif #endif Loading Loading @@ -276,13 +278,7 @@ int snd_register_device(int type, struct snd_card *card, int dev, preg->private_data = private_data; preg->private_data = private_data; preg->card_ptr = card; preg->card_ptr = card; mutex_lock(&sound_mutex); mutex_lock(&sound_mutex); #ifdef CONFIG_SND_DYNAMIC_MINORS minor = snd_find_free_minor(type, card, dev); minor = snd_find_free_minor(type); #else minor = snd_kernel_minor(type, card, dev); if (minor >= 0 && snd_minors[minor]) minor = -EBUSY; #endif if (minor < 0) { if (minor < 0) { err = minor; err = minor; goto error; goto error; Loading