diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-02-20 05:57:34 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 04:30:43 -0500 |
commit | 8278ca8feb2748cf02d756ac6c5b9ab2e047c84a (patch) | |
tree | a58ddfa8d7ac897c02e4ba3bda9b77e278348fbf | |
parent | 1a56f8d662ec7fc86f2c408d289fa07cdb781746 (diff) |
[ALSA] Fix check of enable module option
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>
-rw-r--r-- | sound/drivers/dummy.c | 4 | ||||
-rw-r--r-- | sound/drivers/mpu401/mpu401.c | 4 | ||||
-rw-r--r-- | sound/drivers/serial-u16550.c | 4 | ||||
-rw-r--r-- | sound/drivers/virmidi.c | 4 | ||||
-rw-r--r-- | sound/isa/ad1848/ad1848.c | 4 | ||||
-rw-r--r-- | sound/isa/cs423x/cs4231.c | 4 | ||||
-rw-r--r-- | sound/isa/cs423x/cs4236.c | 4 | ||||
-rw-r--r-- | sound/isa/es1688/es1688.c | 4 | ||||
-rw-r--r-- | sound/isa/es18xx.c | 4 | ||||
-rw-r--r-- | sound/isa/gus/gusclassic.c | 4 | ||||
-rw-r--r-- | sound/isa/gus/gusextreme.c | 4 | ||||
-rw-r--r-- | sound/isa/gus/gusmax.c | 4 | ||||
-rw-r--r-- | sound/isa/gus/interwave.c | 4 | ||||
-rw-r--r-- | sound/isa/opl3sa2.c | 4 | ||||
-rw-r--r-- | sound/isa/sb/sb16.c | 4 | ||||
-rw-r--r-- | sound/isa/sb/sb8.c | 4 | ||||
-rw-r--r-- | sound/isa/sgalaxy.c | 4 | ||||
-rw-r--r-- | sound/isa/wavefront/wavefront.c | 4 |
18 files changed, 51 insertions, 21 deletions
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 14e1a671b5cf..e35fd5779a9d 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c | |||
@@ -669,8 +669,10 @@ static int __init alsa_card_dummy_init(void) | |||
669 | return err; | 669 | return err; |
670 | 670 | ||
671 | cards = 0; | 671 | cards = 0; |
672 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 672 | for (i = 0; i < SNDRV_CARDS; i++) { |
673 | struct platform_device *device; | 673 | struct platform_device *device; |
674 | if (! enable[i]) | ||
675 | continue; | ||
674 | device = platform_device_register_simple(SND_DUMMY_DRIVER, | 676 | device = platform_device_register_simple(SND_DUMMY_DRIVER, |
675 | i, NULL, 0); | 677 | i, NULL, 0); |
676 | if (IS_ERR(device)) { | 678 | if (IS_ERR(device)) { |
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index 915589a402ab..9d10d79e27af 100644 --- a/sound/drivers/mpu401/mpu401.c +++ b/sound/drivers/mpu401/mpu401.c | |||
@@ -240,8 +240,10 @@ static int __init alsa_card_mpu401_init(void) | |||
240 | return err; | 240 | return err; |
241 | 241 | ||
242 | devices = 0; | 242 | devices = 0; |
243 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 243 | for (i = 0; i < SNDRV_CARDS; i++) { |
244 | struct platform_device *device; | 244 | struct platform_device *device; |
245 | if (! enable[i]) | ||
246 | continue; | ||
245 | #ifdef CONFIG_PNP | 247 | #ifdef CONFIG_PNP |
246 | if (pnp[i]) | 248 | if (pnp[i]) |
247 | continue; | 249 | continue; |
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 112ddf705402..13b46d12564a 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c | |||
@@ -989,8 +989,10 @@ static int __init alsa_card_serial_init(void) | |||
989 | return err; | 989 | return err; |
990 | 990 | ||
991 | cards = 0; | 991 | cards = 0; |
992 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 992 | for (i = 0; i < SNDRV_CARDS; i++) { |
993 | struct platform_device *device; | 993 | struct platform_device *device; |
994 | if (! enable[i]) | ||
995 | continue; | ||
994 | device = platform_device_register_simple(SND_SERIAL_DRIVER, | 996 | device = platform_device_register_simple(SND_SERIAL_DRIVER, |
995 | i, NULL, 0); | 997 | i, NULL, 0); |
996 | if (IS_ERR(device)) { | 998 | if (IS_ERR(device)) { |
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c index 4258723de2ab..a3ee306239c9 100644 --- a/sound/drivers/virmidi.c +++ b/sound/drivers/virmidi.c | |||
@@ -163,8 +163,10 @@ static int __init alsa_card_virmidi_init(void) | |||
163 | return err; | 163 | return err; |
164 | 164 | ||
165 | cards = 0; | 165 | cards = 0; |
166 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 166 | for (i = 0; i < SNDRV_CARDS; i++) { |
167 | struct platform_device *device; | 167 | struct platform_device *device; |
168 | if (! enable[i]) | ||
169 | continue; | ||
168 | device = platform_device_register_simple(SND_VIRMIDI_DRIVER, | 170 | device = platform_device_register_simple(SND_VIRMIDI_DRIVER, |
169 | i, NULL, 0); | 171 | i, NULL, 0); |
170 | if (IS_ERR(device)) { | 172 | if (IS_ERR(device)) { |
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c index e091bbeffd2a..326a057f752f 100644 --- a/sound/isa/ad1848/ad1848.c +++ b/sound/isa/ad1848/ad1848.c | |||
@@ -187,8 +187,10 @@ static int __init alsa_card_ad1848_init(void) | |||
187 | return err; | 187 | return err; |
188 | 188 | ||
189 | cards = 0; | 189 | cards = 0; |
190 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 190 | for (i = 0; i < SNDRV_CARDS; i++) { |
191 | struct platform_device *device; | 191 | struct platform_device *device; |
192 | if (! enable[i]) | ||
193 | continue; | ||
192 | device = platform_device_register_simple(SND_AD1848_DRIVER, | 194 | device = platform_device_register_simple(SND_AD1848_DRIVER, |
193 | i, NULL, 0); | 195 | i, NULL, 0); |
194 | if (IS_ERR(device)) { | 196 | if (IS_ERR(device)) { |
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c index ab67b5c2590d..a30dcd962525 100644 --- a/sound/isa/cs423x/cs4231.c +++ b/sound/isa/cs423x/cs4231.c | |||
@@ -203,8 +203,10 @@ static int __init alsa_card_cs4231_init(void) | |||
203 | return err; | 203 | return err; |
204 | 204 | ||
205 | cards = 0; | 205 | cards = 0; |
206 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 206 | for (i = 0; i < SNDRV_CARDS; i++) { |
207 | struct platform_device *device; | 207 | struct platform_device *device; |
208 | if (! enable[i]) | ||
209 | continue; | ||
208 | device = platform_device_register_simple(SND_CS4231_DRIVER, | 210 | device = platform_device_register_simple(SND_CS4231_DRIVER, |
209 | i, NULL, 0); | 211 | i, NULL, 0); |
210 | if (IS_ERR(device)) { | 212 | if (IS_ERR(device)) { |
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index 99a42138bea0..4060918e0327 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c | |||
@@ -771,9 +771,9 @@ static int __init alsa_card_cs423x_init(void) | |||
771 | if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0) | 771 | if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0) |
772 | return err; | 772 | return err; |
773 | 773 | ||
774 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 774 | for (i = 0; i < SNDRV_CARDS; i++) { |
775 | struct platform_device *device; | 775 | struct platform_device *device; |
776 | if (is_isapnp_selected(i)) | 776 | if (! enable[i] || is_isapnp_selected(i)) |
777 | continue; | 777 | continue; |
778 | device = platform_device_register_simple(CS423X_DRIVER, | 778 | device = platform_device_register_simple(CS423X_DRIVER, |
779 | i, NULL, 0); | 779 | i, NULL, 0); |
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c index 50d23cf3d7cc..2b69fc829265 100644 --- a/sound/isa/es1688/es1688.c +++ b/sound/isa/es1688/es1688.c | |||
@@ -207,8 +207,10 @@ static int __init alsa_card_es1688_init(void) | |||
207 | return err; | 207 | return err; |
208 | 208 | ||
209 | cards = 0; | 209 | cards = 0; |
210 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 210 | for (i = 0; i < SNDRV_CARDS; i++) { |
211 | struct platform_device *device; | 211 | struct platform_device *device; |
212 | if (! enable[i]) | ||
213 | continue; | ||
212 | device = platform_device_register_simple(ES1688_DRIVER, | 214 | device = platform_device_register_simple(ES1688_DRIVER, |
213 | i, NULL, 0); | 215 | i, NULL, 0); |
214 | if (IS_ERR(device)) { | 216 | if (IS_ERR(device)) { |
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index 79785808dd60..bb709264216f 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c | |||
@@ -2381,9 +2381,9 @@ static int __init alsa_card_es18xx_init(void) | |||
2381 | if ((err = platform_driver_register(&snd_es18xx_nonpnp_driver)) < 0) | 2381 | if ((err = platform_driver_register(&snd_es18xx_nonpnp_driver)) < 0) |
2382 | return err; | 2382 | return err; |
2383 | 2383 | ||
2384 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 2384 | for (i = 0; i < SNDRV_CARDS; i++) { |
2385 | struct platform_device *device; | 2385 | struct platform_device *device; |
2386 | if (is_isapnp_selected(i)) | 2386 | if (! enable[i] || is_isapnp_selected(i)) |
2387 | continue; | 2387 | continue; |
2388 | device = platform_device_register_simple(ES18XX_DRIVER, | 2388 | device = platform_device_register_simple(ES18XX_DRIVER, |
2389 | i, NULL, 0); | 2389 | i, NULL, 0); |
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c index 91c219116d7a..26dccfea2437 100644 --- a/sound/isa/gus/gusclassic.c +++ b/sound/isa/gus/gusclassic.c | |||
@@ -247,8 +247,10 @@ static int __init alsa_card_gusclassic_init(void) | |||
247 | return err; | 247 | return err; |
248 | 248 | ||
249 | cards = 0; | 249 | cards = 0; |
250 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 250 | for (i = 0; i < SNDRV_CARDS; i++) { |
251 | struct platform_device *device; | 251 | struct platform_device *device; |
252 | if (! enable[i]) | ||
253 | continue; | ||
252 | device = platform_device_register_simple(GUSCLASSIC_DRIVER, | 254 | device = platform_device_register_simple(GUSCLASSIC_DRIVER, |
253 | i, NULL, 0); | 255 | i, NULL, 0); |
254 | if (IS_ERR(device)) { | 256 | if (IS_ERR(device)) { |
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c index 239f16e6b9ee..31dc20501d0c 100644 --- a/sound/isa/gus/gusextreme.c +++ b/sound/isa/gus/gusextreme.c | |||
@@ -357,8 +357,10 @@ static int __init alsa_card_gusextreme_init(void) | |||
357 | return err; | 357 | return err; |
358 | 358 | ||
359 | cards = 0; | 359 | cards = 0; |
360 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 360 | for (i = 0; i < SNDRV_CARDS; i++) { |
361 | struct platform_device *device; | 361 | struct platform_device *device; |
362 | if (! enable[i]) | ||
363 | continue; | ||
362 | device = platform_device_register_simple(GUSEXTREME_DRIVER, | 364 | device = platform_device_register_simple(GUSEXTREME_DRIVER, |
363 | i, NULL, 0); | 365 | i, NULL, 0); |
364 | if (IS_ERR(device)) { | 366 | if (IS_ERR(device)) { |
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index d4d2b2a517d5..cafb9b67fa72 100644 --- a/sound/isa/gus/gusmax.c +++ b/sound/isa/gus/gusmax.c | |||
@@ -384,8 +384,10 @@ static int __init alsa_card_gusmax_init(void) | |||
384 | return err; | 384 | return err; |
385 | 385 | ||
386 | cards = 0; | 386 | cards = 0; |
387 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 387 | for (i = 0; i < SNDRV_CARDS; i++) { |
388 | struct platform_device *device; | 388 | struct platform_device *device; |
389 | if (! enable[i]) | ||
390 | continue; | ||
389 | device = platform_device_register_simple(GUSMAX_DRIVER, | 391 | device = platform_device_register_simple(GUSMAX_DRIVER, |
390 | i, NULL, 0); | 392 | i, NULL, 0); |
391 | if (IS_ERR(device)) { | 393 | if (IS_ERR(device)) { |
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index 9838d992b101..2cacd0fa6871 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c | |||
@@ -935,8 +935,10 @@ static int __init alsa_card_interwave_init(void) | |||
935 | if ((err = platform_driver_register(&snd_interwave_driver)) < 0) | 935 | if ((err = platform_driver_register(&snd_interwave_driver)) < 0) |
936 | return err; | 936 | return err; |
937 | 937 | ||
938 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 938 | for (i = 0; i < SNDRV_CARDS; i++) { |
939 | struct platform_device *device; | 939 | struct platform_device *device; |
940 | if (! enable[i]) | ||
941 | continue; | ||
940 | #ifdef CONFIG_PNP | 942 | #ifdef CONFIG_PNP |
941 | if (isapnp[i]) | 943 | if (isapnp[i]) |
942 | continue; | 944 | continue; |
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 9d8431978501..56fcd8a946a4 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c | |||
@@ -949,8 +949,10 @@ static int __init alsa_card_opl3sa2_init(void) | |||
949 | if ((err = platform_driver_register(&snd_opl3sa2_nonpnp_driver)) < 0) | 949 | if ((err = platform_driver_register(&snd_opl3sa2_nonpnp_driver)) < 0) |
950 | return err; | 950 | return err; |
951 | 951 | ||
952 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 952 | for (i = 0; i < SNDRV_CARDS; i++) { |
953 | struct platform_device *device; | 953 | struct platform_device *device; |
954 | if (! enable[i]) | ||
955 | continue; | ||
954 | #ifdef CONFIG_PNP | 956 | #ifdef CONFIG_PNP |
955 | if (isapnp[i]) | 957 | if (isapnp[i]) |
956 | continue; | 958 | continue; |
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c index 0667bd14ad60..5737ab76160c 100644 --- a/sound/isa/sb/sb16.c +++ b/sound/isa/sb/sb16.c | |||
@@ -712,9 +712,9 @@ static int __init alsa_card_sb16_init(void) | |||
712 | if ((err = platform_driver_register(&snd_sb16_nonpnp_driver)) < 0) | 712 | if ((err = platform_driver_register(&snd_sb16_nonpnp_driver)) < 0) |
713 | return err; | 713 | return err; |
714 | 714 | ||
715 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 715 | for (i = 0; i < SNDRV_CARDS; i++) { |
716 | struct platform_device *device; | 716 | struct platform_device *device; |
717 | if (is_isapnp_selected(i)) | 717 | if (! enable[i] || is_isapnp_selected(i)) |
718 | continue; | 718 | continue; |
719 | device = platform_device_register_simple(SND_SB16_DRIVER, | 719 | device = platform_device_register_simple(SND_SB16_DRIVER, |
720 | i, NULL, 0); | 720 | i, NULL, 0); |
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index 60ee79cd14a3..3efa23d303c3 100644 --- a/sound/isa/sb/sb8.c +++ b/sound/isa/sb/sb8.c | |||
@@ -258,8 +258,10 @@ static int __init alsa_card_sb8_init(void) | |||
258 | return err; | 258 | return err; |
259 | 259 | ||
260 | cards = 0; | 260 | cards = 0; |
261 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 261 | for (i = 0; i < SNDRV_CARDS; i++) { |
262 | struct platform_device *device; | 262 | struct platform_device *device; |
263 | if (! enable[i]) | ||
264 | continue; | ||
263 | device = platform_device_register_simple(SND_SB8_DRIVER, | 265 | device = platform_device_register_simple(SND_SB8_DRIVER, |
264 | i, NULL, 0); | 266 | i, NULL, 0); |
265 | if (IS_ERR(device)) { | 267 | if (IS_ERR(device)) { |
diff --git a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c index 0dbbb35b242c..a60e66afbf90 100644 --- a/sound/isa/sgalaxy.c +++ b/sound/isa/sgalaxy.c | |||
@@ -360,8 +360,10 @@ static int __init alsa_card_sgalaxy_init(void) | |||
360 | return err; | 360 | return err; |
361 | 361 | ||
362 | cards = 0; | 362 | cards = 0; |
363 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 363 | for (i = 0; i < SNDRV_CARDS; i++) { |
364 | struct platform_device *device; | 364 | struct platform_device *device; |
365 | if (! enable[i]) | ||
366 | continue; | ||
365 | device = platform_device_register_simple(SND_SGALAXY_DRIVER, | 367 | device = platform_device_register_simple(SND_SGALAXY_DRIVER, |
366 | i, NULL, 0); | 368 | i, NULL, 0); |
367 | if (IS_ERR(device)) { | 369 | if (IS_ERR(device)) { |
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index fa3ab960de17..c0115bf9065e 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c | |||
@@ -710,8 +710,10 @@ static int __init alsa_card_wavefront_init(void) | |||
710 | if ((err = platform_driver_register(&snd_wavefront_driver)) < 0) | 710 | if ((err = platform_driver_register(&snd_wavefront_driver)) < 0) |
711 | return err; | 711 | return err; |
712 | 712 | ||
713 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 713 | for (i = 0; i < SNDRV_CARDS; i++) { |
714 | struct platform_device *device; | 714 | struct platform_device *device; |
715 | if (! enable[i]) | ||
716 | continue; | ||
715 | #ifdef CONFIG_PNP | 717 | #ifdef CONFIG_PNP |
716 | if (isapnp[i]) | 718 | if (isapnp[i]) |
717 | continue; | 719 | continue; |