staging: speakup: move spk_stop_serial_interrupt into synth-specific release function
authorOkash Khawaja <okash.khawaja@gmail.com>
Tue, 14 Mar 2017 13:41:54 +0000 (13:41 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Mar 2017 02:12:02 +0000 (11:12 +0900)
This moves call to spk_stop_serial_interrupt() function out of synth_release()
and into release() method of specific spk_synth instances. This is because
the spk_stop_serial_interrupt() call is specific to current serial i/o
implementation. Moving it into each synth's release() method gives the
decision of calling  spk_stop_serial_interrupt() to that synth.

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>
drivers/staging/speakup/serialio.c
drivers/staging/speakup/speakup_acntpc.c
drivers/staging/speakup/speakup_decpc.c
drivers/staging/speakup/speakup_dtlk.c
drivers/staging/speakup/speakup_keypc.c
drivers/staging/speakup/synth.c

index d7736f7a35fe81e1dbe6398a44978ef80e38cd72..b37d476f4c8056b808bf5e07139c9202cd9ed02f 100644 (file)
@@ -148,6 +148,7 @@ void spk_stop_serial_interrupt(void)
        /* Free IRQ */
        free_irq(serstate->irq, (void *)synth_readbuf_handler);
 }
+EXPORT_SYMBOL_GPL(spk_stop_serial_interrupt);
 
 int spk_wait_for_xmitr(struct spk_synth *in_synth)
 {
@@ -223,6 +224,7 @@ int spk_serial_out(struct spk_synth *in_synth, const char ch)
 
 void spk_serial_release(void)
 {
+       spk_stop_serial_interrupt();
        if (speakup_info.port_tts == 0)
                return;
        synth_release_region(speakup_info.port_tts, 8);
index 81dd0c0917dc40cf5caca10a13c06a02cb8916eb..c5beb5602c42b019e7a285ea34f7a787e540355c 100644 (file)
@@ -304,6 +304,7 @@ static int synth_probe(struct spk_synth *synth)
 
 static void accent_release(void)
 {
+       spk_stop_serial_interrupt();
        if (speakup_info.port_tts)
                synth_release_region(speakup_info.port_tts-1, SYNTH_IO_EXTENT);
        speakup_info.port_tts = 0;
index a4c5807b38de840faa1fa68f56b944d406cacded..2a738be197897028adf584034a998e6fcfa755b9 100644 (file)
@@ -481,6 +481,7 @@ static int synth_probe(struct spk_synth *synth)
 
 static void dtpc_release(void)
 {
+       spk_stop_serial_interrupt();
        if (speakup_info.port_tts)
                synth_release_region(speakup_info.port_tts, SYNTH_IO_EXTENT);
        speakup_info.port_tts = 0;
index e5a434376d35380b9b2b9fa1d06b066e90f9c85b..279739a94c798fe8b6b70f9ea97ad2a6f4a39152 100644 (file)
@@ -375,6 +375,7 @@ static int synth_probe(struct spk_synth *synth)
 
 static void dtlk_release(void)
 {
+       spk_stop_serial_interrupt();
        if (speakup_info.port_tts)
                synth_release_region(speakup_info.port_tts-1, SYNTH_IO_EXTENT);
        speakup_info.port_tts = 0;
index 9eb9352e5db789af65f926b82c70a97e966888bd..6649fa4c0ad224d4c070649a1a3e5a1d577c70bc 100644 (file)
@@ -306,6 +306,7 @@ static int synth_probe(struct spk_synth *synth)
 
 static void keynote_release(void)
 {
+       spk_stop_serial_interrupt();
        if (synth_port)
                synth_release_region(synth_port, SYNTH_IO_EXTENT);
        synth_port = 0;
index 72d4f027e40a33d5f1c5c46ccebc3595057c7d59..989681dcb710e1a11200534005577d803aed6856 100644 (file)
@@ -462,7 +462,6 @@ void synth_release(void)
                sysfs_remove_group(speakup_kobj, &synth->attributes);
        for (var = synth->vars; var->var_id != MAXVARS; var++)
                speakup_unregister_var(var->var_id);
-       spk_stop_serial_interrupt();
        synth->release();
        synth = NULL;
 }