Update of /cvsroot/alsa/alsa-kernel/isa/gus In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15244/gus
Modified Files: gusclassic.c gusextreme.c gusmax.c interwave.c Log Message: <[EMAIL PROTECTED]> This is a *really* silly one. The various probing routines in these drivers can return -ENODEV, -ENOMEM etc.. so when we do something like cards += probe_routine() In some situations we can end up with -13 sound cards, and other such nonsense. Result : lots of fun oopses. Index: gusclassic.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/isa/gus/gusclassic.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- gusclassic.c 14 Oct 2003 13:08:16 -0000 1.12 +++ gusclassic.c 15 Mar 2004 19:33:52 -0000 1.13 @@ -238,7 +238,7 @@ static int __init alsa_card_gusclassic_init(void) { static unsigned long possible_ports[] = {0x220, 0x230, 0x240, 0x250, 0x260, -1}; - int dev, cards; + int dev, cards, i; for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) { if (port[dev] == SNDRV_AUTO_PORT) @@ -246,7 +246,10 @@ if (snd_gusclassic_probe(dev) >= 0) cards++; } - cards += snd_legacy_auto_probe(possible_ports, snd_gusclassic_legacy_auto_probe); + i = snd_legacy_auto_probe(possible_ports, snd_gusclassic_legacy_auto_probe); + if (i > 0) + cards += i; + if (!cards) { #ifdef MODULE printk(KERN_ERR "GUS Classic soundcard not found or device busy\n"); Index: gusextreme.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/isa/gus/gusextreme.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- gusextreme.c 15 Mar 2004 19:29:13 -0000 1.13 +++ gusextreme.c 15 Mar 2004 19:33:52 -0000 1.14 @@ -349,7 +349,7 @@ static int __init alsa_card_gusextreme_init(void) { static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1}; - int dev, cards; + int dev, cards, i; for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev] > 0; dev++) { if (port[dev] == SNDRV_AUTO_PORT) @@ -357,7 +357,10 @@ if (snd_gusextreme_probe(dev) >= 0) cards++; } - cards += snd_legacy_auto_probe(possible_ports, snd_gusextreme_legacy_auto_probe); + i = snd_legacy_auto_probe(possible_ports, snd_gusextreme_legacy_auto_probe); + if (i > 0) + cards += i; + if (!cards) { #ifdef MODULE printk(KERN_ERR "GUS Extreme soundcard not found or device busy\n"); Index: gusmax.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/isa/gus/gusmax.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- gusmax.c 14 Oct 2003 13:08:18 -0000 1.13 +++ gusmax.c 15 Mar 2004 19:33:52 -0000 1.14 @@ -378,7 +378,7 @@ static int __init alsa_card_gusmax_init(void) { static unsigned long possible_ports[] = {0x220, 0x230, 0x240, 0x250, 0x260, -1}; - int dev, cards; + int dev, cards, i; for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev] > 0; dev++) { if (port[dev] == SNDRV_AUTO_PORT) @@ -386,7 +386,10 @@ if (snd_gusmax_probe(dev) >= 0) cards++; } - cards += snd_legacy_auto_probe(possible_ports, snd_gusmax_legacy_auto_probe); + i = snd_legacy_auto_probe(possible_ports, snd_gusmax_legacy_auto_probe); + if (i > 0) + cards += i; + if (!cards) { #ifdef MODULE printk(KERN_ERR "GUS MAX soundcard not found or device busy\n"); Index: interwave.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/isa/gus/interwave.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- interwave.c 31 Jan 2004 08:52:27 -0000 1.31 +++ interwave.c 15 Mar 2004 19:33:52 -0000 1.32 @@ -929,7 +929,7 @@ static int __init alsa_card_interwave_init(void) { - int cards = 0; + int cards = 0, i; static long possible_ports[] = {0x210, 0x220, 0x230, 0x240, 0x250, 0x260, -1}; int dev; @@ -949,10 +949,14 @@ #endif } /* legacy auto configured cards */ - cards += snd_legacy_auto_probe(possible_ports, snd_interwave_probe_legacy_port); + i = snd_legacy_auto_probe(possible_ports, snd_interwave_probe_legacy_port); + if (i > 0) + cards += i; #ifdef CONFIG_PNP - /* ISA PnP cards */ - cards += pnp_register_card_driver(&interwave_pnpc_driver); + /* ISA PnP cards */ + i = pnp_register_card_driver(&interwave_pnpc_driver); + if (i > 0) + cards += i; #endif if (!cards) { ------------------------------------------------------- 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