]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: Fix limit of 8 PCM devices in SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE
authorPawel MOLL <pawel.moll@st.com>
Tue, 29 Jul 2008 16:34:26 +0000 (17:34 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 29 Jul 2008 19:32:48 +0000 (21:32 +0200)
commit0362eae9ad28f9b0c8ff6011497699e0f06e973e
tree818bef3892109c05a4ad5ec3ae5e90dd4436c0c6
parent347d7450ddaa5c0f626750adde560520ffbb240d
ALSA: Fix limit of 8 PCM devices in SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE

When compiled with CONFIG_SND_DYNAMIC_MINORS the ALSA core is fine
to have more than 8 PCM devices per card, except one place - the
SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE ioctl, which will not enumerate
devices > 7. This patch fixes the issue, changing the devices list
organisation.

Instead of adding new device to the tail, the list is now kept always
ordered (by card number, then device number). Thus, during enumeration,
it is easy to discover the fact that there is no more given card's
devices. The same limit was present in OSS emulation code. It has
been fixed as well.

Additionally the device field of struct snd_pcm is now int, instead of
unsigned int, as there is no obvious reason for keeping it unsigned.
This caused a lot of problems with comparing this value with other
(almost always signed) variables. There is just one more place where
device number is unsigned - in struct snd_pcm_info, which should be
also sorted out in future.

Signed-off-by: Pawel MOLL <pawel.moll@st.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
include/sound/minors.h
include/sound/pcm.h
sound/core/oss/pcm_oss.c
sound/core/pcm.c
sound/core/sound.c