patch-2.4.0-test7 linux/drivers/sound/audio.c

Next file: linux/drivers/sound/awe_wave.c
Previous file: linux/drivers/sound/aedsp16.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test6/linux/drivers/sound/audio.c linux/drivers/sound/audio.c
@@ -82,14 +82,15 @@
 	if (dev < 0 || dev >= num_audiodevs)
 		return -ENXIO;
 
+	if (audio_devs[dev]->d->owner)
+		__MOD_INC_USE_COUNT (audio_devs[dev]->d->owner);
+
 	if ((ret = DMAbuf_open(dev, mode)) < 0)
 		return ret;
 
-	if (audio_devs[dev]->coproc)
-	{
+	if (audio_devs[dev]->coproc) {
 		if ((ret = audio_devs[dev]->coproc->
-			open(audio_devs[dev]->coproc->devc, COPR_PCM)) < 0)
-		{
+			open(audio_devs[dev]->coproc->devc, COPR_PCM)) < 0) {
 			audio_release(dev, file);
 			printk(KERN_WARNING "Sound: Can't access coprocessor device\n");
 			return ret;
@@ -178,6 +179,9 @@
 	if (audio_devs[dev]->coproc)
 		audio_devs[dev]->coproc->close(audio_devs[dev]->coproc->devc, COPR_PCM);
 	DMAbuf_release(dev, mode);
+
+	if (audio_devs[dev]->d->owner)
+		__MOD_DEC_USE_COUNT (audio_devs[dev]->d->owner);
 }
 
 static void translate_bytes(const unsigned char *table, unsigned char *buff, int n)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)