fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / sound / oss / midibuf.c
index 1b91796..a40be0c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * sound/midibuf.c
+ * sound/oss/midibuf.c
  *
  * Device file manager for /dev/midi#
  */
@@ -50,10 +50,10 @@ static struct midi_parms parms[MAX_MIDI_DEV];
 static void midi_poll(unsigned long dummy);
 
 
-static struct timer_list poll_timer = TIMER_INITIALIZER(midi_poll, 0, 0);
+static DEFINE_TIMER(poll_timer, midi_poll, 0, 0);
 
 static volatile int open_devs;
-static spinlock_t lock=SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(lock);
 
 #define DATA_AVAIL(q) (q->len)
 #define SPACE_AVAIL(q) (MAX_QUEUE_SIZE - q->len)
@@ -256,7 +256,7 @@ void MIDIbuf_release(int dev, struct file *file)
        module_put(midi_devs[dev]->owner);
 }
 
-int MIDIbuf_write(int dev, struct file *file, const char *buf, int count)
+int MIDIbuf_write(int dev, struct file *file, const char __user *buf, int count)
 {
        int c, n, i;
        unsigned char tmp_data;
@@ -310,7 +310,7 @@ out:
 }
 
 
-int MIDIbuf_read(int dev, struct file *file, char *buf, int count)
+int MIDIbuf_read(int dev, struct file *file, char __user *buf, int count)
 {
        int n, c = 0;
        unsigned char tmp_data;
@@ -359,7 +359,7 @@ out:
 }
 
 int MIDIbuf_ioctl(int dev, struct file *file,
-                 unsigned int cmd, caddr_t arg)
+                 unsigned int cmd, void __user *arg)
 {
        int val;
 
@@ -377,13 +377,13 @@ int MIDIbuf_ioctl(int dev, struct file *file,
                switch (cmd) 
                {
                        case SNDCTL_MIDI_PRETIME:
-                               if (get_user(val, (int *)arg))
+                               if (get_user(val, (int __user *)arg))
                                        return -EFAULT;
                                if (val < 0)
                                        val = 0;
                                val = (HZ * val) / 10;
                                parms[dev].prech_timeout = val;
-                               return put_user(val, (int *)arg);
+                               return put_user(val, (int __user *)arg);
                        
                        default:
                                if (!midi_devs[dev]->ioctl)
@@ -414,18 +414,11 @@ unsigned int MIDIbuf_poll(int dev, struct file *file, poll_table * wait)
 }
 
 
-void MIDIbuf_init(void)
-{
-       /* drag in midi_syms.o */
-       {
-               extern char midi_syms_symbol;
-               midi_syms_symbol = 0;
-       }
-}
-
 int MIDIbuf_avail(int dev)
 {
        if (midi_in_buf[dev])
                return DATA_AVAIL (midi_in_buf[dev]);
        return 0;
 }
+EXPORT_SYMBOL(MIDIbuf_avail);
+