From: William Hubbs Date: Mon, 13 May 2013 18:31:40 +0000 (-0500) Subject: staging: speakup: remove custom locking macro definitions X-Git-Tag: next-20130521~23^2~126 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=667b614118b3bae7d2a82732cdde71730a3d080c;p=karo-tx-linux.git staging: speakup: remove custom locking macro definitions Signed-off-by: William Hubbs Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/speakup/spk_priv.h b/drivers/staging/speakup/spk_priv.h index 141125c3a54e..637ba6760ec0 100644 --- a/drivers/staging/speakup/spk_priv.h +++ b/drivers/staging/speakup/spk_priv.h @@ -77,16 +77,4 @@ extern struct speakup_info_t speakup_info; extern struct var_t synth_time_vars[]; -/* Protect the whole speakup machinery, must be taken at each kernel->speakup - * transition and released at all corresponding speakup->kernel transitions - * (flags must be the same variable between lock/trylock and unlock). - * - * The progression thread only interferes with the speakup machinery through - * the synth buffer, and so only needs to take the lock while tinkering with - * it. - */ -/* Speakup needs to disable the keyboard IRQ, hence _irqsave/restore */ -#define spk_lock(flags) spin_lock_irqsave(&speakup_info.spinlock, flags) -#define spk_unlock(flags) spin_unlock_irqrestore(&speakup_info.spinlock, flags) - #endif diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c index 1036f47b9464..e2d84c090d64 100644 --- a/drivers/staging/speakup/synth.c +++ b/drivers/staging/speakup/synth.c @@ -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, };