Skip to contentSkip to conversation

Oops in 2.4.18 - opl3sa2 related?

PATCH New Zwane Mwaikambo 1 participant 2 messages Apr 10, 2002 – Apr 12, 2002 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 Oops in 2.4.18 - opl3sa2 related?

In reply to a message not in the archive

This patch fixes a missing release_region in the opl3sa2 driver, however there are still a few more issues left which Brian is experiencing.

drivers/sound/opl3sa2.c renamed from drivers/sound/opl3sa2.c.orig +10 -6
@@ -641,7 +641,7 @@
 	if(!request_region(hw_config->io_base, 2, OPL3SA2_MODULE_NAME)) {
 		printk(KERN_ERR PFX "Control I/O port %#x not free\n",
 		       hw_config->io_base);
-		return 0;
+		goto out_nodev;
 	}
 
 	/*
@@ -654,7 +654,7 @@
 	if(tmp != misc) {
 		printk(KERN_ERR PFX "Control I/O port %#x is not a YMF7xx chipset!\n",
 		       hw_config->io_base);
-		return 0;
+		goto out_region;
 	}
 
 	/*
@@ -667,7 +667,7 @@
 		printk(KERN_ERR
 		       PFX "Control I/O port %#x is not a YMF7xx chipset!\n",
 		       hw_config->io_base);
-		return 0;
+		goto out_region;
 	}
 	opl3sa2_write(hw_config->io_base, OPL3SA2_MIC, tmp);
 
@@ -714,9 +714,13 @@
 	if(opl3sa2_state[card].chipset != CHIPSET_UNKNOWN) {
 		/* Generate a pretty name */
 		opl3sa2_state[card].chipset_name = (char *)CHIPSET_TABLE[opl3sa2_state[card].chipset];
-		return 1;
+		return 0;
 	}
-	return 0;
+
+out_region:
+	release_region(hw_config->iobase, 2);
+out_nodev:
+	return -ENODEV;
 }
 
 
@@ -1061,7 +1065,7 @@
 			opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mpu);
 		}
 
-		if(!probe_opl3sa2(&opl3sa2_state[card].cfg, card) ||
+		if(probe_opl3sa2(&opl3sa2_state[card].cfg, card) ||
 		   !probe_opl3sa2_mss(&opl3sa2_state[card].cfg_mss)) {
 			/*
 			 * If one or more cards are already registered, don't
Signature · 1 line
http://function.linuxpower.ca
#2 lore raw

PATCH 1/1 Oops in 2.4.18 - opl3sa2 related? (typo fix)

Slight typo...

drivers/sound/opl3sa2.c renamed from drivers/sound/opl3sa2.c.orig +10 -6
@@ -641,7 +641,7 @@
 	if(!request_region(hw_config->io_base, 2, OPL3SA2_MODULE_NAME)) {
 		printk(KERN_ERR PFX "Control I/O port %#x not free\n",
 		       hw_config->io_base);
-		return 0;
+		goto out_nodev;
 	}
 
 	/*
@@ -654,7 +654,7 @@
 	if(tmp != misc) {
 		printk(KERN_ERR PFX "Control I/O port %#x is not a YMF7xx chipset!\n",
 		       hw_config->io_base);
-		return 0;
+		goto out_region;
 	}
 
 	/*
@@ -667,7 +667,7 @@
 		printk(KERN_ERR
 		       PFX "Control I/O port %#x is not a YMF7xx chipset!\n",
 		       hw_config->io_base);
-		return 0;
+		goto out_region;
 	}
 	opl3sa2_write(hw_config->io_base, OPL3SA2_MIC, tmp);
 
@@ -714,9 +714,13 @@
 	if(opl3sa2_state[card].chipset != CHIPSET_UNKNOWN) {
 		/* Generate a pretty name */
 		opl3sa2_state[card].chipset_name = (char *)CHIPSET_TABLE[opl3sa2_state[card].chipset];
-		return 1;
+		return 0;
 	}
-	return 0;
+
+out_region:
+	release_region(hw_config->io_base, 2);
+out_nodev:
+	return -ENODEV;
 }
 
 
@@ -1061,7 +1065,7 @@
 			opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mpu);
 		}
 
-		if(!probe_opl3sa2(&opl3sa2_state[card].cfg, card) ||
+		if(probe_opl3sa2(&opl3sa2_state[card].cfg, card) ||
 		   !probe_opl3sa2_mss(&opl3sa2_state[card].cfg_mss)) {
 			/*
 			 * If one or more cards are already registered, don't
Signature · 1 line
http://function.linuxpower.ca