mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-13 00:20:06 +00:00
staging: speakup: dectlk: remove custom locking macros
Signed-off-by: William Hubbs <w.d.hubbs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4d888b292a
commit
68743d6b26
@ -216,9 +216,9 @@ static void do_catch_up(struct spk_synth *synth)
|
|||||||
|
|
||||||
jiffy_delta = spk_get_var(JIFFY);
|
jiffy_delta = spk_get_var(JIFFY);
|
||||||
delay_time = spk_get_var(DELAY);
|
delay_time = spk_get_var(DELAY);
|
||||||
spk_lock(flags);
|
spin_lock_irqsave(&speakup_info.spinlock, flags);
|
||||||
jiffy_delta_val = jiffy_delta->u.n.value;
|
jiffy_delta_val = jiffy_delta->u.n.value;
|
||||||
spk_unlock(flags);
|
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
|
||||||
jiff_max = jiffies + jiffy_delta_val;
|
jiff_max = jiffies + jiffy_delta_val;
|
||||||
|
|
||||||
while (!kthread_should_stop()) {
|
while (!kthread_should_stop()) {
|
||||||
@ -234,22 +234,22 @@ static void do_catch_up(struct spk_synth *synth)
|
|||||||
is_flushing = 0;
|
is_flushing = 0;
|
||||||
spin_unlock_irqrestore(&flush_lock, flags);
|
spin_unlock_irqrestore(&flush_lock, flags);
|
||||||
|
|
||||||
spk_lock(flags);
|
spin_lock_irqsave(&speakup_info.spinlock, flags);
|
||||||
if (speakup_info.flushing) {
|
if (speakup_info.flushing) {
|
||||||
speakup_info.flushing = 0;
|
speakup_info.flushing = 0;
|
||||||
spk_unlock(flags);
|
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
|
||||||
synth->flush(synth);
|
synth->flush(synth);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (synth_buffer_empty()) {
|
if (synth_buffer_empty()) {
|
||||||
spk_unlock(flags);
|
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ch = synth_buffer_peek();
|
ch = synth_buffer_peek();
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
set_current_state(TASK_INTERRUPTIBLE);
|
||||||
delay_time_val = delay_time->u.n.value;
|
delay_time_val = delay_time->u.n.value;
|
||||||
synth_full_val = synth_full();
|
synth_full_val = synth_full();
|
||||||
spk_unlock(flags);
|
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
|
||||||
if (ch == '\n')
|
if (ch == '\n')
|
||||||
ch = 0x0D;
|
ch = 0x0D;
|
||||||
if (synth_full_val || !spk_serial_out(ch)) {
|
if (synth_full_val || !spk_serial_out(ch)) {
|
||||||
@ -257,9 +257,9 @@ static void do_catch_up(struct spk_synth *synth)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
set_current_state(TASK_RUNNING);
|
set_current_state(TASK_RUNNING);
|
||||||
spk_lock(flags);
|
spin_lock_irqsave(&speakup_info.spinlock, flags);
|
||||||
synth_buffer_getc();
|
synth_buffer_getc();
|
||||||
spk_unlock(flags);
|
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
|
||||||
if (ch == '[')
|
if (ch == '[')
|
||||||
in_escape = 1;
|
in_escape = 1;
|
||||||
else if (ch == ']')
|
else if (ch == ']')
|
||||||
@ -270,10 +270,10 @@ static void do_catch_up(struct spk_synth *synth)
|
|||||||
if (jiffies >= jiff_max) {
|
if (jiffies >= jiff_max) {
|
||||||
if (!in_escape)
|
if (!in_escape)
|
||||||
spk_serial_out(PROCSPEECH);
|
spk_serial_out(PROCSPEECH);
|
||||||
spk_lock(flags);
|
spin_lock_irqsave(&speakup_info.spinlock, flags);
|
||||||
jiffy_delta_val = jiffy_delta->u.n.value;
|
jiffy_delta_val = jiffy_delta->u.n.value;
|
||||||
delay_time_val = delay_time->u.n.value;
|
delay_time_val = delay_time->u.n.value;
|
||||||
spk_unlock(flags);
|
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
|
||||||
schedule_timeout(msecs_to_jiffies
|
schedule_timeout(msecs_to_jiffies
|
||||||
(delay_time_val));
|
(delay_time_val));
|
||||||
jiff_max = jiffies + jiffy_delta_val;
|
jiff_max = jiffies + jiffy_delta_val;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user