]> git.baikalelectronics.ru Git - kernel.git/commit
speakup: Reference synth from tty and tty from synth
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 26 Jan 2021 22:21:45 +0000 (23:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jan 2021 12:12:04 +0000 (13:12 +0100)
commitc19fcd9c0fb30488f2963a2d91e23fc245b5b9cf
treec412ef9dafdcd0ede50ec301fb7ed6c699b2712e
parent3f21070db16a9b357cb43199b0f44340870e1a4f
speakup: Reference synth from tty and tty from synth

We do not actually need speakup_tty and spk_ttyio_synth global
variables, the synth can store the pointer to the tty, and the tty
ldisc_data can store the pointer to the synth.

Along the way, we can clench the initialization of the synth and the
creation of the tty, so that tty is never NULL. Even if the device
disappears (e.g. USB unplug), the tty structure will still be there,
and we automatically stop speakup in the spk_ttyio_out error handler
but keep tty until the user cleans things up.

As a result, this simplifies locking a lot.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Link: https://lore.kernel.org/r/20210126222147.3848175-3-samuel.thibault@ens-lyon.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/accessibility/speakup/spk_ttyio.c
drivers/accessibility/speakup/spk_types.h