]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/speakup/synth.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[~andy/linux] / drivers / staging / speakup / synth.c
index 1036f47b94643ca56f3b08231622c97bcd714db9..0b3549bd909d0619a594155f91a3f18372eeb7be 100644 (file)
@@ -25,6 +25,18 @@ static int module_status;
 bool spk_quiet_boot;
 
 struct speakup_info_t speakup_info = {
+       /*
+        * This spinlock is used to protect the entire speakup machinery, and
+        * must be taken at each kernel->speakup transition and released at
+        * each corresponding speakup->kernel transition.
+        *
+        * The progression thread only interferes with the speakup machinery through
+        * the synth buffer, so only needs to take the lock while tinkering with
+        * the buffer.
+        *
+        * We use spin_lock/trylock_irqsave and spin_unlock_irqrestore with this
+        * spinlock because speakup needs to disable the keyboard IRQ.
+        */
        .spinlock = __SPIN_LOCK_UNLOCKED(speakup_info.spinlock),
        .flushing = 0,
 };
@@ -145,7 +157,7 @@ const char *spk_synth_immediate(struct spk_synth *synth, const char *buff)
                        return buff;
                buff++;
        }
-       return 0;
+       return NULL;
 }
 EXPORT_SYMBOL_GPL(spk_synth_immediate);