patch-2.1.6 linux/drivers/sound/sound_timer.c

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

diff -u --recursive --new-file v2.1.5/linux/drivers/sound/sound_timer.c linux/drivers/sound/sound_timer.c
@@ -4,7 +4,7 @@
 /*
  * Copyright (C) by Hannu Savolainen 1993-1996
  *
- * USS/Lite for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
+ * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
  * Version 2 (June 1991). See the "COPYING" file distributed with this software
  * for more info.
  */
@@ -94,7 +94,7 @@
 timer_open (int dev, int mode)
 {
   if (opened)
-    return -(EBUSY);
+    return -EBUSY;
 
   tmr_reset ();
   curr_tempo = 60;
@@ -193,7 +193,7 @@
   switch (cmd)
     {
     case SNDCTL_TMR_SOURCE:
-      return snd_ioctl_return ((int *) arg, TMR_INTERNAL);
+      return ioctl_out (arg, TMR_INTERNAL);
       break;
 
     case SNDCTL_TMR_START:
@@ -214,7 +214,9 @@
 
     case SNDCTL_TMR_TIMEBASE:
       {
-	int             val = get_user ((int *) arg);
+	int             val;
+
+	get_user (val, (int *) arg);
 
 	if (val)
 	  {
@@ -225,13 +227,15 @@
 	    curr_timebase = val;
 	  }
 
-	return snd_ioctl_return ((int *) arg, curr_timebase);
+	return ioctl_out (arg, curr_timebase);
       }
       break;
 
     case SNDCTL_TMR_TEMPO:
       {
-	int             val = get_user ((int *) arg);
+	int             val;
+
+	get_user (val, (int *) arg);
 
 	if (val)
 	  {
@@ -246,15 +250,19 @@
 	    reprogram_timer ();
 	  }
 
-	return snd_ioctl_return ((int *) arg, curr_tempo);
+	return ioctl_out (arg, curr_tempo);
       }
       break;
 
     case SNDCTL_SEQ_CTRLRATE:
-      if (get_user ((int *) arg) != 0)	/* Can't change */
-	return -(EINVAL);
+      if (ioctl_in (arg) != 0)	/* Can't change */
+	return -EINVAL;
+
+      return ioctl_out (arg, ((curr_tempo * curr_timebase) + 30) / 60);
+      break;
 
-      return snd_ioctl_return ((int *) arg, ((curr_tempo * curr_timebase) + 30) / 60);
+    case SNDCTL_SEQ_GETTIME:
+      return ioctl_out (arg, curr_ticks);
       break;
 
     case SNDCTL_TMR_METRONOME:
@@ -264,7 +272,7 @@
     default:;
     }
 
-  return -(EINVAL);
+  return -EINVAL;
 }
 
 static void

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