Skip to contentSkip to conversation

a few more -- fix the "enable" module parameter behaviour

PATCH In review Rene Herman 1 participant 1 message Apr 13, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 a few more -- fix the "enable" module parameter behaviour

Hi Takashi.

The !enable[i] patch is also applicable to sound/drivers. This gets them all.

  sound/drivers/dummy.c         |    4 +++-
  sound/drivers/mpu401/mpu401.c |    4 +++-
  sound/drivers/serial-u16550.c |    4 +++-
  sound/drivers/virmidi.c       |    4 +++-
  4 files changed, 12 insertions(+), 4 deletions(-)
sound/drivers/dummy.c +3 -1
Index: local/sound/drivers/dummy.c
===================================================================
@@ -669,8 +669,10 @@ static int __init alsa_card_dummy_init(v
 		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)) {
sound/drivers/mpu401/mpu401.c +3 -1
Index: local/sound/drivers/mpu401/mpu401.c
===================================================================
@@ -240,8 +240,10 @@ static int __init alsa_card_mpu401_init(
 		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;
sound/drivers/serial-u16550.c +3 -1
Index: local/sound/drivers/serial-u16550.c
===================================================================
@@ -989,8 +989,10 @@ static int __init alsa_card_serial_init(
 		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)) {
sound/drivers/virmidi.c +3 -1
Index: local/sound/drivers/virmidi.c
===================================================================
@@ -163,8 +163,10 @@ static int __init alsa_card_virmidi_init
 		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)) {