Update of /cvsroot/alsa/alsa-kernel/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv807/core
Modified Files: init.c Log Message: - show the error message when the given card index is not available. Index: init.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/core/init.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- init.c 24 Oct 2003 13:43:59 -0000 1.41 +++ init.c 4 Mar 2004 17:52:46 -0000 1.42 @@ -79,6 +79,7 @@ goto __error; strlcpy(card->id, xid, sizeof(card->id)); } + err = 0; write_lock(&snd_card_rwlock); if (idx < 0) { int idx2; @@ -94,15 +95,14 @@ idx = snd_ecards_limit++; } else if (idx < snd_ecards_limit) { if (snd_cards_lock & (1 << idx)) - idx = -1; /* invalid */ + err = -ENODEV; /* invalid */ } else if (idx < SNDRV_CARDS) snd_ecards_limit = idx + 1; /* increase the limit */ else - idx = -1; - if (idx < 0) { + err = -ENODEV; + if (idx < 0 || err < 0) { write_unlock(&snd_card_rwlock); - if (idx >= snd_ecards_limit) - snd_printk(KERN_ERR "card %i is out of range (0-%i)\n", idx, snd_ecards_limit-1); + snd_printk(KERN_ERR "cannot find the slot for index %d (range 0-%i)\n", idx, snd_ecards_limit - 1); goto __error; } snd_cards_lock |= 1 << idx; /* lock it */ ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog