[ALSA] Fix check of enable module option
authorTakashi Iwai <tiwai@suse.de>
Mon, 20 Feb 2006 10:57:34 +0000 (11:57 +0100)
committerJaroslav Kysela <perex@suse.cz>
Wed, 22 Mar 2006 09:30:43 +0000 (10:30 +0100)
Fix the check of enable module option in probe of platform_device drivers.
It shouldn't break the loop but just ignore if enable[i] is false.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
18 files changed:
sound/drivers/dummy.c
sound/drivers/mpu401/mpu401.c
sound/drivers/serial-u16550.c
sound/drivers/virmidi.c
sound/isa/ad1848/ad1848.c
sound/isa/cs423x/cs4231.c
sound/isa/cs423x/cs4236.c
sound/isa/es1688/es1688.c
sound/isa/es18xx.c
sound/isa/gus/gusclassic.c
sound/isa/gus/gusextreme.c
sound/isa/gus/gusmax.c
sound/isa/gus/interwave.c
sound/isa/opl3sa2.c
sound/isa/sb/sb16.c
sound/isa/sb/sb8.c
sound/isa/sgalaxy.c
sound/isa/wavefront/wavefront.c

index 14e1a67..e35fd57 100644 (file)
@@ -669,8 +669,10 @@ static int __init alsa_card_dummy_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(SND_DUMMY_DRIVER,
                                                         i, NULL, 0);
                if (IS_ERR(device)) {
index 915589a..9d10d79 100644 (file)
@@ -240,8 +240,10 @@ static int __init alsa_card_mpu401_init(void)
                return err;
 
        devices = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
 #ifdef CONFIG_PNP
                if (pnp[i])
                        continue;
index 112ddf7..13b46d1 100644 (file)
@@ -989,8 +989,10 @@ static int __init alsa_card_serial_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(SND_SERIAL_DRIVER,
                                                         i, NULL, 0);
                if (IS_ERR(device)) {
index 4258723..a3ee306 100644 (file)
@@ -163,8 +163,10 @@ static int __init alsa_card_virmidi_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(SND_VIRMIDI_DRIVER,
                                                         i, NULL, 0);
                if (IS_ERR(device)) {
index e091bbe..326a057 100644 (file)
@@ -187,8 +187,10 @@ static int __init alsa_card_ad1848_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(SND_AD1848_DRIVER,
                                                         i, NULL, 0);
                if (IS_ERR(device)) {
index ab67b5c..a30dcd9 100644 (file)
@@ -203,8 +203,10 @@ static int __init alsa_card_cs4231_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(SND_CS4231_DRIVER,
                                                         i, NULL, 0);
                if (IS_ERR(device)) {
index 99a4213..4060918 100644 (file)
@@ -771,9 +771,9 @@ static int __init alsa_card_cs423x_init(void)
        if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0)
                return err;
 
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
-               if (is_isapnp_selected(i))
+               if (! enable[i] || is_isapnp_selected(i))
                        continue;
                device = platform_device_register_simple(CS423X_DRIVER,
                                                         i, NULL, 0);
index 50d23cf..2b69fc8 100644 (file)
@@ -207,8 +207,10 @@ static int __init alsa_card_es1688_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(ES1688_DRIVER,
                                                         i, NULL, 0);
                if (IS_ERR(device)) {
index 7978580..bb70926 100644 (file)
@@ -2381,9 +2381,9 @@ static int __init alsa_card_es18xx_init(void)
        if ((err = platform_driver_register(&snd_es18xx_nonpnp_driver)) < 0)
                return err;
 
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
-               if (is_isapnp_selected(i))
+               if (! enable[i] || is_isapnp_selected(i))
                        continue;
                device = platform_device_register_simple(ES18XX_DRIVER,
                                                         i, NULL, 0);
index 91c2191..26dccfe 100644 (file)
@@ -247,8 +247,10 @@ static int __init alsa_card_gusclassic_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(GUSCLASSIC_DRIVER,
                                                         i, NULL, 0);
                if (IS_ERR(device)) {
index 239f16e..31dc205 100644 (file)
@@ -357,8 +357,10 @@ static int __init alsa_card_gusextreme_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(GUSEXTREME_DRIVER,
                                                         i, NULL, 0);
                if (IS_ERR(device)) {
index d4d2b2a..cafb9b6 100644 (file)
@@ -384,8 +384,10 @@ static int __init alsa_card_gusmax_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(GUSMAX_DRIVER,
                                                         i, NULL, 0);
                if (IS_ERR(device)) {
index 9838d99..2cacd0f 100644 (file)
@@ -935,8 +935,10 @@ static int __init alsa_card_interwave_init(void)
        if ((err = platform_driver_register(&snd_interwave_driver)) < 0)
                return err;
 
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
 #ifdef CONFIG_PNP
                if (isapnp[i])
                        continue;
index 9d84319..56fcd8a 100644 (file)
@@ -949,8 +949,10 @@ static int __init alsa_card_opl3sa2_init(void)
        if ((err = platform_driver_register(&snd_opl3sa2_nonpnp_driver)) < 0)
                return err;
 
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
 #ifdef CONFIG_PNP
                if (isapnp[i])
                        continue;
index 0667bd1..5737ab7 100644 (file)
@@ -712,9 +712,9 @@ static int __init alsa_card_sb16_init(void)
        if ((err = platform_driver_register(&snd_sb16_nonpnp_driver)) < 0)
                return err;
 
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
-               if (is_isapnp_selected(i))
+               if (! enable[i] || is_isapnp_selected(i))
                        continue;
                device = platform_device_register_simple(SND_SB16_DRIVER,
                                                         i, NULL, 0);
index 60ee79c..3efa23d 100644 (file)
@@ -258,8 +258,10 @@ static int __init alsa_card_sb8_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(SND_SB8_DRIVER,
                                                         i, NULL, 0);
                if (IS_ERR(device)) {
index 0dbbb35..a60e66a 100644 (file)
@@ -360,8 +360,10 @@ static int __init alsa_card_sgalaxy_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(SND_SGALAXY_DRIVER,
                                                         i, NULL, 0);
                if (IS_ERR(device)) {
index fa3ab96..c0115bf 100644 (file)
@@ -710,8 +710,10 @@ static int __init alsa_card_wavefront_init(void)
        if ((err = platform_driver_register(&snd_wavefront_driver)) < 0)
                return err;
 
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
 #ifdef CONFIG_PNP
                if (isapnp[i])
                        continue;