patch-2.1.127 linux/drivers/sound/es1371.c

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

diff -u --recursive --new-file v2.1.126/linux/drivers/sound/es1371.c linux/drivers/sound/es1371.c
@@ -1462,11 +1462,8 @@
                 }
 		tmo = (count * HZ) / s->dac1rate;
 		tmo >>= sample_shift[(s->sctrl & SCTRL_P1FMT) >> SCTRL_SH_P1FMT];
-		current->timeout = jiffies + (tmo ? tmo : 1);
-                schedule();
-		if (tmo && !current->timeout)
+		if (!schedule_timeout(tmo ? : 1) && tmo)
 			printk(KERN_DEBUG "es1371: dma timed out??\n");
-		current->timeout = 0;
         }
         remove_wait_queue(&s->dma_dac1.wait, &wait);
         current->state = TASK_RUNNING;
@@ -1500,11 +1497,8 @@
                 }
 		tmo = (count * HZ) / s->dac2rate;
 		tmo >>= sample_shift[(s->sctrl & SCTRL_P2FMT) >> SCTRL_SH_P2FMT];
-		current->timeout = jiffies + (tmo ? tmo : 1);
-                schedule();
-		if (tmo && !current->timeout)
+		if (!schedule_timeout(tmo ? : 1) && tmo)
 			printk(KERN_DEBUG "es1371: dma timed out??\n");
-		current->timeout = 0;
         }
         remove_wait_queue(&s->dma_dac2.wait, &wait);
         current->state = TASK_RUNNING;
@@ -2635,11 +2629,8 @@
 				return -EBUSY;
 			}
 			tmo = (count * HZ) / 3100;
-			current->timeout = tmo ? jiffies + tmo : 0;
-			schedule();
-			if (tmo && !current->timeout)
+			if (!schedule_timeout(tmo ? : 1) && tmo)
 				printk(KERN_DEBUG "es1371: midi timed out??\n");
-			current->timeout = 0;
 		}
 		remove_wait_queue(&s->midi.owait, &wait);
 		current->state = TASK_RUNNING;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov