Skip to contentSkip to conversation

fixing a two-rme32-in-one-machine bug

PATCH New Martin Langer 1 participant 1 message Oct 6, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixing a two-rme32-in-one-machine bug

Hi,

it's reported that a machine with two rme32 cards doesn't work (the second card doesn't work) .... and I can't test it here :(

But nevertheless here's the trial of a fix.

The snd_xxx_probe function is now similar to other pci cards.....

martin

Summary:
- fixing the dev counter in snd_rme32_probe(). The patch can enable a second rme32 card now.

rme32.c renamed from rme32.c.ORIGINAL +5 -7
@@ -1970,16 +1970,14 @@
 	snd_card_t *card;
 	int err;
 
-	for (; dev < SNDRV_CARDS; dev++) {
-		if (!enable[dev]) {
-			dev++;
-			return -ENOENT;
-		}
-		break;
-	}
 	if (dev >= SNDRV_CARDS) {
 		return -ENODEV;
 	}
+	if (!enable[dev]) {
+		dev++;
+		return -ENOENT;
+	}
+
 	if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
 				 sizeof(rme32_t))) == NULL)
 		return -ENOMEM;