]> Pileus Git - ~andy/linux/blobdiff - sound/oss/midibuf.c
Merge branch 'fix/hda' into for-linus
[~andy/linux] / sound / oss / midibuf.c
index c0e4bbc22c80de093bca3f2eeab5be997cd87083..782b3b84dac68ccd036c52ee3533336f243ac15b 100644 (file)
@@ -127,15 +127,16 @@ static void midi_poll(unsigned long dummy)
                for (dev = 0; dev < num_midis; dev++)
                        if (midi_devs[dev] != NULL && midi_out_buf[dev] != NULL)
                        {
-                               int ok = 1;
-
-                               while (DATA_AVAIL(midi_out_buf[dev]) && ok)
+                               while (DATA_AVAIL(midi_out_buf[dev]))
                                {
+                                       int ok;
                                        int c = midi_out_buf[dev]->queue[midi_out_buf[dev]->head];
 
                                        spin_unlock_irqrestore(&lock,flags);/* Give some time to others */
                                        ok = midi_devs[dev]->outputc(dev, c);
                                        spin_lock_irqsave(&lock, flags);
+                                       if (!ok)
+                                               break;
                                        midi_out_buf[dev]->head = (midi_out_buf[dev]->head + 1) % MAX_QUEUE_SIZE;
                                        midi_out_buf[dev]->len--;
                                }
@@ -414,18 +415,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);
+