diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-11-20 14:09:05 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 12:29:21 +0100 |
commit | d001544ded23ddb1116f945ccc2d89a7f98ab7e8 (patch) | |
tree | 721fbc6355acfb886817e2b120f198383c5e6ae6 /sound/core/init.c | |
parent | 204bdb1b50013c7aa3922d8b66df943123087bd8 (diff) |
[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 <clemens@ladisch.de>
Diffstat (limited to 'sound/core/init.c')
-rw-r--r-- | sound/core/init.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sound/core/init.c b/sound/core/init.c index 728bb2ce0bc..58e17d385f8 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -338,7 +338,7 @@ int snd_card_free_in_thread(struct snd_card *card) static void choose_default_id(struct snd_card *card) { - int i, len, idx_flag = 0, loops = 8; + int i, len, idx_flag = 0, loops = SNDRV_CARDS; char *id, *spos; id = spos = card->shortname; @@ -380,9 +380,12 @@ static void choose_default_id(struct snd_card *card) __change: len = strlen(id); - if (idx_flag) - id[len-1]++; - else if ((size_t)len <= sizeof(card->id) - 3) { + if (idx_flag) { + if (id[len-1] != '9') + id[len-1]++; + else + id[len-1] = 'A'; + } else if ((size_t)len <= sizeof(card->id) - 3) { strcat(id, "_1"); idx_flag++; } else { @@ -461,12 +464,12 @@ static void snd_card_info_read(struct snd_info_entry *entry, read_lock(&snd_card_rwlock); if ((card = snd_cards[idx]) != NULL) { count++; - snd_iprintf(buffer, "%i [%-15s]: %s - %s\n", + snd_iprintf(buffer, "%2i [%-15s]: %s - %s\n", idx, card->id, card->driver, card->shortname); - snd_iprintf(buffer, " %s\n", + snd_iprintf(buffer, " %s\n", card->longname); } read_unlock(&snd_card_rwlock); @@ -508,7 +511,8 @@ static void snd_card_module_info_read(struct snd_info_entry *entry, for (idx = 0; idx < SNDRV_CARDS; idx++) { read_lock(&snd_card_rwlock); if ((card = snd_cards[idx]) != NULL) - snd_iprintf(buffer, "%i %s\n", idx, card->module->name); + snd_iprintf(buffer, "%2i %s\n", + idx, card->module->name); read_unlock(&snd_card_rwlock); } } |