Commit 74447196 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Jaroslav Kysela <perex@suse.cz>

ES18xx driver,ES1688 driver,GUS Classic driver,GUS Extreme driver
GUS MAX driver,AMD InterWave driver,SB16/AWE driver,SB8 driver
<davej@redhat.com>
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.
parent caf9962c
...@@ -182,7 +182,7 @@ static int __init snd_audiodrive_legacy_auto_probe(unsigned long xport) ...@@ -182,7 +182,7 @@ static int __init snd_audiodrive_legacy_auto_probe(unsigned long xport)
static int __init alsa_card_es1688_init(void) static int __init alsa_card_es1688_init(void)
{ {
static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1}; static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1};
int dev, cards = 0; int dev, cards = 0, i;
for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) { for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) {
if (port[dev] == SNDRV_AUTO_PORT) if (port[dev] == SNDRV_AUTO_PORT)
...@@ -190,7 +190,10 @@ static int __init alsa_card_es1688_init(void) ...@@ -190,7 +190,10 @@ static int __init alsa_card_es1688_init(void)
if (snd_audiodrive_probe(dev) >= 0) if (snd_audiodrive_probe(dev) >= 0)
cards++; cards++;
} }
cards += snd_legacy_auto_probe(possible_ports, snd_audiodrive_legacy_auto_probe); i = snd_legacy_auto_probe(possible_ports, snd_audiodrive_legacy_auto_probe);
if (i > 0)
cards += i;
if (!cards) { if (!cards) {
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n"); printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n");
......
...@@ -2232,7 +2232,7 @@ static struct pnp_card_driver es18xx_pnpc_driver = { ...@@ -2232,7 +2232,7 @@ static struct pnp_card_driver es18xx_pnpc_driver = {
static int __init alsa_card_es18xx_init(void) static int __init alsa_card_es18xx_init(void)
{ {
static unsigned long possible_ports[] = {0x220, 0x240, 0x260, 0x280, -1}; static unsigned long possible_ports[] = {0x220, 0x240, 0x260, 0x280, -1};
int dev, cards = 0; int dev, cards = 0, i;
/* legacy non-auto cards at first */ /* legacy non-auto cards at first */
for (dev = 0; dev < SNDRV_CARDS; dev++) { for (dev = 0; dev < SNDRV_CARDS; dev++) {
...@@ -2246,10 +2246,16 @@ static int __init alsa_card_es18xx_init(void) ...@@ -2246,10 +2246,16 @@ static int __init alsa_card_es18xx_init(void)
cards++; cards++;
} }
/* legacy auto configured cards */ /* legacy auto configured cards */
cards += snd_legacy_auto_probe(possible_ports, snd_audiodrive_probe_legacy_port); i = snd_legacy_auto_probe(possible_ports, snd_audiodrive_probe_legacy_port);
if (i > 0)
cards += i;
#ifdef CONFIG_PNP #ifdef CONFIG_PNP
/* ISA PnP cards at last */ /* ISA PnP cards at last */
cards += pnp_register_card_driver(&es18xx_pnpc_driver); i = pnp_register_card_driver(&es18xx_pnpc_driver);
if (i > 0)
cards += i;
#endif #endif
if(!cards) { if(!cards) {
#ifdef CONFIG_PNP #ifdef CONFIG_PNP
......
...@@ -238,7 +238,7 @@ static int __init snd_gusclassic_legacy_auto_probe(unsigned long xport) ...@@ -238,7 +238,7 @@ static int __init snd_gusclassic_legacy_auto_probe(unsigned long xport)
static int __init alsa_card_gusclassic_init(void) static int __init alsa_card_gusclassic_init(void)
{ {
static unsigned long possible_ports[] = {0x220, 0x230, 0x240, 0x250, 0x260, -1}; 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++) { for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) {
if (port[dev] == SNDRV_AUTO_PORT) if (port[dev] == SNDRV_AUTO_PORT)
...@@ -246,7 +246,10 @@ static int __init alsa_card_gusclassic_init(void) ...@@ -246,7 +246,10 @@ static int __init alsa_card_gusclassic_init(void)
if (snd_gusclassic_probe(dev) >= 0) if (snd_gusclassic_probe(dev) >= 0)
cards++; 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) { if (!cards) {
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "GUS Classic soundcard not found or device busy\n"); printk(KERN_ERR "GUS Classic soundcard not found or device busy\n");
......
...@@ -349,7 +349,7 @@ static int __init snd_gusextreme_legacy_auto_probe(unsigned long xport) ...@@ -349,7 +349,7 @@ static int __init snd_gusextreme_legacy_auto_probe(unsigned long xport)
static int __init alsa_card_gusextreme_init(void) static int __init alsa_card_gusextreme_init(void)
{ {
static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1}; 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++) { for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev] > 0; dev++) {
if (port[dev] == SNDRV_AUTO_PORT) if (port[dev] == SNDRV_AUTO_PORT)
...@@ -357,7 +357,10 @@ static int __init alsa_card_gusextreme_init(void) ...@@ -357,7 +357,10 @@ static int __init alsa_card_gusextreme_init(void)
if (snd_gusextreme_probe(dev) >= 0) if (snd_gusextreme_probe(dev) >= 0)
cards++; 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) { if (!cards) {
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "GUS Extreme soundcard not found or device busy\n"); printk(KERN_ERR "GUS Extreme soundcard not found or device busy\n");
......
...@@ -378,7 +378,7 @@ static int __init snd_gusmax_legacy_auto_probe(unsigned long xport) ...@@ -378,7 +378,7 @@ static int __init snd_gusmax_legacy_auto_probe(unsigned long xport)
static int __init alsa_card_gusmax_init(void) static int __init alsa_card_gusmax_init(void)
{ {
static unsigned long possible_ports[] = {0x220, 0x230, 0x240, 0x250, 0x260, -1}; 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++) { for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev] > 0; dev++) {
if (port[dev] == SNDRV_AUTO_PORT) if (port[dev] == SNDRV_AUTO_PORT)
...@@ -386,7 +386,10 @@ static int __init alsa_card_gusmax_init(void) ...@@ -386,7 +386,10 @@ static int __init alsa_card_gusmax_init(void)
if (snd_gusmax_probe(dev) >= 0) if (snd_gusmax_probe(dev) >= 0)
cards++; 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) { if (!cards) {
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "GUS MAX soundcard not found or device busy\n"); printk(KERN_ERR "GUS MAX soundcard not found or device busy\n");
......
...@@ -929,7 +929,7 @@ static struct pnp_card_driver interwave_pnpc_driver = { ...@@ -929,7 +929,7 @@ static struct pnp_card_driver interwave_pnpc_driver = {
static int __init alsa_card_interwave_init(void) 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}; static long possible_ports[] = {0x210, 0x220, 0x230, 0x240, 0x250, 0x260, -1};
int dev; int dev;
...@@ -949,10 +949,14 @@ static int __init alsa_card_interwave_init(void) ...@@ -949,10 +949,14 @@ static int __init alsa_card_interwave_init(void)
#endif #endif
} }
/* legacy auto configured cards */ /* 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 #ifdef CONFIG_PNP
/* ISA PnP cards */ /* ISA PnP cards */
cards += pnp_register_card_driver(&interwave_pnpc_driver); i = pnp_register_card_driver(&interwave_pnpc_driver);
if (i > 0)
cards += i;
#endif #endif
if (!cards) { if (!cards) {
......
...@@ -629,7 +629,7 @@ static struct pnp_card_driver sb16_pnpc_driver = { ...@@ -629,7 +629,7 @@ static struct pnp_card_driver sb16_pnpc_driver = {
static int __init alsa_card_sb16_init(void) static int __init alsa_card_sb16_init(void)
{ {
int dev, cards = 0; int dev, cards = 0, i;
static unsigned long possible_ports[] = {0x220, 0x240, 0x260, 0x280, -1}; static unsigned long possible_ports[] = {0x220, 0x240, 0x260, 0x280, -1};
/* legacy non-auto cards at first */ /* legacy non-auto cards at first */
...@@ -649,10 +649,15 @@ static int __init alsa_card_sb16_init(void) ...@@ -649,10 +649,15 @@ static int __init alsa_card_sb16_init(void)
#endif #endif
} }
/* legacy auto configured cards */ /* legacy auto configured cards */
cards += snd_legacy_auto_probe(possible_ports, snd_sb16_probe_legacy_port); i = snd_legacy_auto_probe(possible_ports, snd_sb16_probe_legacy_port);
if (i > 0)
cards += i;
#ifdef CONFIG_PNP #ifdef CONFIG_PNP
/* PnP cards at last */ /* PnP cards at last */
cards += pnp_register_card_driver(&sb16_pnpc_driver); i = pnp_register_card_driver(&sb16_pnpc_driver);
if (i >0)
cards += i;
#endif #endif
if (!cards) { if (!cards) {
......
...@@ -199,7 +199,7 @@ static int __init snd_card_sb8_legacy_auto_probe(unsigned long xport) ...@@ -199,7 +199,7 @@ static int __init snd_card_sb8_legacy_auto_probe(unsigned long xport)
static int __init alsa_card_sb8_init(void) static int __init alsa_card_sb8_init(void)
{ {
static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1}; 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]; dev++) { for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) {
if (port[dev] == SNDRV_AUTO_PORT) if (port[dev] == SNDRV_AUTO_PORT)
...@@ -207,7 +207,10 @@ static int __init alsa_card_sb8_init(void) ...@@ -207,7 +207,10 @@ static int __init alsa_card_sb8_init(void)
if (snd_sb8_probe(dev) >= 0) if (snd_sb8_probe(dev) >= 0)
cards++; cards++;
} }
cards += snd_legacy_auto_probe(possible_ports, snd_card_sb8_legacy_auto_probe); i = snd_legacy_auto_probe(possible_ports, snd_card_sb8_legacy_auto_probe);
if (i > 0)
cards += i;
if (!cards) { if (!cards) {
#ifdef MODULE #ifdef MODULE
snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n"); snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment