Commit 91418706 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Clemens Ladisch <clemens@ladisch.de>

MPU401 UART
use global variable to count cards
parent 9c78d8a1
...@@ -87,6 +87,7 @@ struct acpi_device; ...@@ -87,6 +87,7 @@ struct acpi_device;
#endif #endif
static snd_card_t *snd_mpu401_legacy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; static snd_card_t *snd_mpu401_legacy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
static int cards;
#ifdef USE_ACPI_PNP #ifdef USE_ACPI_PNP
...@@ -206,6 +207,7 @@ static int __devinit snd_card_mpu401_probe(int dev, struct acpi_device *device) ...@@ -206,6 +207,7 @@ static int __devinit snd_card_mpu401_probe(int dev, struct acpi_device *device)
else else
#endif #endif
snd_mpu401_legacy_cards[dev] = card; snd_mpu401_legacy_cards[dev] = card;
++cards;
return 0; return 0;
} }
...@@ -259,15 +261,11 @@ static struct acpi_driver snd_mpu401_acpi_driver = { ...@@ -259,15 +261,11 @@ static struct acpi_driver snd_mpu401_acpi_driver = {
static int __init alsa_card_mpu401_init(void) static int __init alsa_card_mpu401_init(void)
{ {
int dev, cards; int dev;
#ifdef USE_ACPI_PNP #ifdef USE_ACPI_PNP
cards = acpi_bus_register_driver(&snd_mpu401_acpi_driver); if (acpi_bus_register_driver(&snd_mpu401_acpi_driver) >= 0)
if (cards >= 0)
acpi_driver_registered = 1; acpi_driver_registered = 1;
else
#else
cards = 0;
#endif #endif
for (dev = 0; dev < SNDRV_CARDS; dev++) { for (dev = 0; dev < SNDRV_CARDS; dev++) {
if (!enable[dev]) if (!enable[dev])
...@@ -276,8 +274,7 @@ static int __init alsa_card_mpu401_init(void) ...@@ -276,8 +274,7 @@ static int __init alsa_card_mpu401_init(void)
if (acpipnp[dev] && acpi_driver_registered) if (acpipnp[dev] && acpi_driver_registered)
continue; continue;
#endif #endif
if (snd_card_mpu401_probe(dev, NULL) >= 0) snd_card_mpu401_probe(dev, NULL);
cards++;
} }
if (!cards) { if (!cards) {
#ifdef MODULE #ifdef MODULE
......
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