Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 779ae5a0 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: Fix the card number limit of OSS-emulation



There are left-over codes from the ancient days with the static device
number limitation of 8.  Actaully OSS can support up to 16 cards.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a2e888f0
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -35,7 +35,7 @@
#include <linux/sound.h>
#include <linux/sound.h>
#include <linux/mutex.h>
#include <linux/mutex.h>


#define SNDRV_OSS_MINORS 128
#define SNDRV_OSS_MINORS 256


static struct snd_minor *snd_oss_minors[SNDRV_OSS_MINORS];
static struct snd_minor *snd_oss_minors[SNDRV_OSS_MINORS];
static DEFINE_MUTEX(sound_oss_mutex);
static DEFINE_MUTEX(sound_oss_mutex);
@@ -111,7 +111,7 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev,
	int register1 = -1, register2 = -1;
	int register1 = -1, register2 = -1;
	struct device *carddev = snd_card_get_device_link(card);
	struct device *carddev = snd_card_get_device_link(card);


	if (card && card->number >= 8)
	if (card && card->number >= SNDRV_MINOR_OSS_DEVICES)
		return 0; /* ignore silently */
		return 0; /* ignore silently */
	if (minor < 0)
	if (minor < 0)
		return minor;
		return minor;
@@ -170,7 +170,7 @@ int snd_unregister_oss_device(int type, struct snd_card *card, int dev)
	int track2 = -1;
	int track2 = -1;
	struct snd_minor *mptr;
	struct snd_minor *mptr;


	if (card && card->number >= 8)
	if (card && card->number >= SNDRV_MINOR_OSS_DEVICES)
		return 0;
		return 0;
	if (minor < 0)
	if (minor < 0)
		return minor;
		return minor;