Commit 6697330a authored by William Hubbs's avatar William Hubbs Committed by Greg Kroah-Hartman

staging: speakup: synth: remove custom locking macros

Signed-off-by: default avatarWilliam Hubbs <w.d.hubbs@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 939d84ee
...@@ -83,27 +83,27 @@ void spk_do_catch_up(struct spk_synth *synth) ...@@ -83,27 +83,27 @@ void spk_do_catch_up(struct spk_synth *synth)
full_time = spk_get_var(FULL); full_time = spk_get_var(FULL);
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()) {
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);
full_time_val = full_time->u.n.value; full_time_val = full_time->u.n.value;
spk_unlock(flags); spin_unlock_irqrestore(&speakup_info.spinlock, flags);
if (ch == '\n') if (ch == '\n')
ch = synth->procspeech; ch = synth->procspeech;
if (!spk_serial_out(ch)) { if (!spk_serial_out(ch)) {
...@@ -111,11 +111,11 @@ void spk_do_catch_up(struct spk_synth *synth) ...@@ -111,11 +111,11 @@ void spk_do_catch_up(struct spk_synth *synth)
continue; continue;
} }
if ((jiffies >= jiff_max) && (ch == SPACE)) { if ((jiffies >= jiff_max) && (ch == SPACE)) {
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;
full_time_val = full_time->u.n.value; full_time_val = full_time->u.n.value;
spk_unlock(flags); spin_unlock_irqrestore(&speakup_info.spinlock, flags);
if (spk_serial_out(synth->procspeech)) if (spk_serial_out(synth->procspeech))
schedule_timeout( schedule_timeout(
msecs_to_jiffies(delay_time_val)); msecs_to_jiffies(delay_time_val));
...@@ -125,9 +125,9 @@ void spk_do_catch_up(struct spk_synth *synth) ...@@ -125,9 +125,9 @@ void spk_do_catch_up(struct spk_synth *synth)
jiff_max = jiffies + jiffy_delta_val; jiff_max = jiffies + jiffy_delta_val;
} }
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);
} }
spk_serial_out(synth->procspeech); spk_serial_out(synth->procspeech);
} }
...@@ -403,11 +403,11 @@ void synth_release(void) ...@@ -403,11 +403,11 @@ void synth_release(void)
if (synth == NULL) if (synth == NULL)
return; return;
spk_lock(flags); spin_lock_irqsave(&speakup_info.spinlock, flags);
pr_info("releasing synth %s\n", synth->name); pr_info("releasing synth %s\n", synth->name);
synth->alive = 0; synth->alive = 0;
del_timer(&thread_timer); del_timer(&thread_timer);
spk_unlock(flags); spin_unlock_irqrestore(&speakup_info.spinlock, flags);
if (synth->attributes.name) if (synth->attributes.name)
sysfs_remove_group(speakup_kobj, &(synth->attributes)); sysfs_remove_group(speakup_kobj, &(synth->attributes));
for (var = synth->vars; var->var_id != MAXVARS; var++) for (var = synth->vars; var->var_id != MAXVARS; var++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment