From d001544ded23ddb1116f945ccc2d89a7f98ab7e8 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Sun, 20 Nov 2005 14:09:05 +0100 Subject: [ALSA] dynamic minors (6/6): increase maximum number of sound cards Modules: ALSA Core,Memalloc module,ALSA sequencer With dynamic minor numbers, we can increase the number of sound cards. This requires that the sequencer client numbers of some kernel drivers are allocated dynamically, too. Signed-off-by: Clemens Ladisch --- sound/core/sound_oss.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sound/core/sound_oss.c') diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c index b9e89cac4c5d..3ae1c0d7ffd0 100644 --- a/sound/core/sound_oss.c +++ b/sound/core/sound_oss.c @@ -105,6 +105,8 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev, int register1 = -1, register2 = -1; struct device *carddev = NULL; + if (card && card->number >= 8) + return 0; /* ignore silently */ if (minor < 0) return minor; preg = kmalloc(sizeof(struct snd_minor), GFP_KERNEL); @@ -162,6 +164,8 @@ int snd_unregister_oss_device(int type, struct snd_card *card, int dev) int track2 = -1; struct snd_minor *mptr; + if (card && card->number >= 8) + return 0; if (minor < 0) return minor; down(&sound_oss_mutex); -- cgit v1.2.3