aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorOkash Khawaja <okash.khawaja@gmail.com>2017-07-16 12:18:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-18 03:03:21 -0400
commit9f8dced2085c33a633d2f0a1abbf13ff5a7ed8c9 (patch)
treed65cd2110cff79cad93e5261a436648156b84e37 /drivers
parent216ce2962089b6218708bf87d96e6b1fbadba1d7 (diff)
staging: speakup: add functions to register and unregister ldisc
This patch adds the above two functions and makes them available to main.c where they will be called during init and exit functions of main speakup module. Following patch will make use of them. Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/speakup/spk_priv.h2
-rw-r--r--drivers/staging/speakup/spk_ttyio.c12
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/staging/speakup/spk_priv.h b/drivers/staging/speakup/spk_priv.h
index 87b6a0a4c54d..046040ac074c 100644
--- a/drivers/staging/speakup/spk_priv.h
+++ b/drivers/staging/speakup/spk_priv.h
@@ -48,6 +48,8 @@ void spk_stop_serial_interrupt(void);
48int spk_wait_for_xmitr(struct spk_synth *in_synth); 48int spk_wait_for_xmitr(struct spk_synth *in_synth);
49void spk_serial_release(void); 49void spk_serial_release(void);
50void spk_ttyio_release(void); 50void spk_ttyio_release(void);
51void spk_ttyio_register_ldisc(void);
52void spk_ttyio_unregister_ldisc(void);
51 53
52void synth_buffer_skip_nonlatin1(void); 54void synth_buffer_skip_nonlatin1(void);
53u16 synth_buffer_getc(void); 55u16 synth_buffer_getc(void);
diff --git a/drivers/staging/speakup/spk_ttyio.c b/drivers/staging/speakup/spk_ttyio.c
index 924034a3de4b..9b02345f66cc 100644
--- a/drivers/staging/speakup/spk_ttyio.c
+++ b/drivers/staging/speakup/spk_ttyio.c
@@ -200,6 +200,18 @@ static int spk_ttyio_initialise_ldisc(struct spk_synth *synth)
200 return ret; 200 return ret;
201} 201}
202 202
203void spk_ttyio_register_ldisc(void)
204{
205 if (tty_register_ldisc(N_SPEAKUP, &spk_ttyio_ldisc_ops))
206 pr_warn("speakup: Error registering line discipline. Most synths won't work.\n");
207}
208
209void spk_ttyio_unregister_ldisc(void)
210{
211 if (tty_unregister_ldisc(N_SPEAKUP))
212 pr_warn("speakup: Couldn't unregister ldisc\n");
213}
214
203static int spk_ttyio_out(struct spk_synth *in_synth, const char ch) 215static int spk_ttyio_out(struct spk_synth *in_synth, const char ch)
204{ 216{
205 if (in_synth->alive && speakup_tty && speakup_tty->ops->write) { 217 if (in_synth->alive && speakup_tty && speakup_tty->ops->write) {