patch-2.2.16 linux/drivers/sound/maestro.c

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

diff -urN v2.2.15/linux/drivers/sound/maestro.c linux/drivers/sound/maestro.c
@@ -2407,10 +2407,24 @@
 	struct ess_state *s = (struct ess_state *)file->private_data;
 	unsigned long flags;
 	unsigned int mask = 0;
+	int ret;
 
 	VALIDATE_STATE(s);
+
+
+/* In 0.14 prog_dmabuf always returns success anyway ... */
+	if (file->f_mode & FMODE_WRITE) {
+		if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) 
+			return POLLERR;
+	}
+	if (file->f_mode & FMODE_READ) {
+	  	if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
+			return POLLERR;
+	}
+
 	if (file->f_mode & (FMODE_WRITE|FMODE_READ))
 		poll_wait(file, &s->poll_wait, wait);
+
 	spin_lock_irqsave(&s->lock, flags);
 	ess_update_ptr(s);
 	if (file->f_mode & FMODE_READ) {
@@ -3448,6 +3462,7 @@
 				unregister_sound_dsp(s->dev_audio);
 		}
 		release_region(card->iobase, 256);		
+		unregister_reboot_notifier(&maestro_nb);
 		kfree(card);
 		return 0;
 	}

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