diff options
author | Okash Khawaja <okash.khawaja@gmail.com> | 2017-03-14 13:41:52 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-16 11:10:18 +0900 |
commit | 9176d156ca8d931bec0bf5fa3239524d94da866a (patch) | |
tree | a3a8f259de1f0380aa9ee7eecfb696bddd9ca51c /drivers/staging/speakup/serialio.c | |
parent | 940f6daec092819674ce26f1b6f0be4bbb9923a8 (diff) |
staging: speakup: spk_serial_out and spk_wait_for_xmitr to take synth arg
These two functions are always called from a context where spk_synth instance
is available. They also use the spk_synth instance but instead of taking it
as an argument, they rely on a global spk_synth instance inside synth.c which
points to the same synth as the one being passed in as argument.
Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/speakup/serialio.c')
-rw-r--r-- | drivers/staging/speakup/serialio.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c index 657a48b6f8d3..f51ab5c25b49 100644 --- a/drivers/staging/speakup/serialio.c +++ b/drivers/staging/speakup/serialio.c @@ -143,14 +143,14 @@ void spk_stop_serial_interrupt(void) free_irq(serstate->irq, (void *)synth_readbuf_handler); } -int spk_wait_for_xmitr(void) +int spk_wait_for_xmitr(struct spk_synth *in_synth) { int tmout = SPK_XMITR_TIMEOUT; - if ((synth->alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) { + if ((in_synth->alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) { pr_warn("%s: too many timeouts, deactivating speakup\n", - synth->long_name); - synth->alive = 0; + in_synth->long_name); + in_synth->alive = 0; /* No synth any more, so nobody will restart TTYs, and we thus * need to do it ourselves. Now that there is no synth we can * let application flood anyway @@ -161,7 +161,7 @@ int spk_wait_for_xmitr(void) } while (spk_serial_tx_busy()) { if (--tmout == 0) { - pr_warn("%s: timed out (tx busy)\n", synth->long_name); + pr_warn("%s: timed out (tx busy)\n", in_synth->long_name); timeouts++; return 0; } @@ -206,9 +206,9 @@ unsigned char spk_serial_in_nowait(void) } EXPORT_SYMBOL_GPL(spk_serial_in_nowait); -int spk_serial_out(const char ch) +int spk_serial_out(struct spk_synth *in_synth, const char ch) { - if (synth->alive && spk_wait_for_xmitr()) { + if (in_synth->alive && spk_wait_for_xmitr(in_synth)) { outb_p(ch, speakup_info.port_tts); return 1; } |