From 8278ca8feb2748cf02d756ac6c5b9ab2e047c84a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 20 Feb 2006 11:57:34 +0100 Subject: [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 --- sound/isa/gus/gusclassic.c | 4 +++- sound/isa/gus/gusextreme.c | 4 +++- sound/isa/gus/gusmax.c | 4 +++- sound/isa/gus/interwave.c | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) (limited to 'sound/isa/gus') diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c index 91c219116d7..26dccfea243 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) 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)) { diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c index 239f16e6b9e..31dc20501d0 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) 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)) { diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index d4d2b2a517d..cafb9b67fa7 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) 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)) { diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index 9838d992b10..2cacd0fa687 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) 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; -- cgit v1.2.3