diff options
author | Pawel MOLL <pawel.moll@st.com> | 2008-07-29 17:34:26 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-07-29 21:32:48 +0200 |
commit | 9423969005586e6e27ca380e01b4a8c50698e2af (patch) | |
tree | 818bef3892109c05a4ad5ec3ae5e90dd4436c0c6 /include/sound | |
parent | 815ecf8dec95d07e260a16ebe8409f4b7c0fdc0f (diff) | |
download | op-kernel-dev-9423969005586e6e27ca380e01b4a8c50698e2af.zip op-kernel-dev-9423969005586e6e27ca380e01b4a8c50698e2af.tar.gz |
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>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/minors.h | 2 | ||||
-rw-r--r-- | include/sound/pcm.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/sound/minors.h b/include/sound/minors.h index 46bcd20..a81798a 100644 --- a/include/sound/minors.h +++ b/include/sound/minors.h @@ -21,6 +21,8 @@ * */ +#define SNDRV_OS_MINORS 256 + #define SNDRV_MINOR_DEVICES 32 #define SNDRV_MINOR_CARD(minor) ((minor) >> 5) #define SNDRV_MINOR_DEVICE(minor) ((minor) & 0x001f) diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 51d58cc..bfc096a 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -84,8 +84,6 @@ struct snd_pcm_ops { * */ -#define SNDRV_PCM_DEVICES 8 - #define SNDRV_PCM_IOCTL1_FALSE ((void *)0) #define SNDRV_PCM_IOCTL1_TRUE ((void *)1) @@ -416,7 +414,7 @@ struct snd_pcm_str { struct snd_pcm { struct snd_card *card; struct list_head list; - unsigned int device; /* device number */ + int device; /* device number */ unsigned int info_flags; unsigned short dev_class; unsigned short dev_subclass; |