/*
- * sound/midibuf.c
+ * sound/oss/midibuf.c
*
* Device file manager for /dev/midi#
*/
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)
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;
}
-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;
}
int MIDIbuf_ioctl(int dev, struct file *file,
- unsigned int cmd, caddr_t arg)
+ unsigned int cmd, void __user *arg)
{
int val;
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)
}
-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);
+