From a50ef3165489c74c7d7c9f7559d9bbb198dca154 Mon Sep 17 00:00:00 2001 From: Okash Khawaja Date: Tue, 14 Mar 2017 13:41:54 +0000 Subject: [PATCH] staging: speakup: move spk_stop_serial_interrupt into synth-specific release function 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 Reviewed-by: Samuel Thibault Signed-off-by: Greg Kroah-Hartman --- drivers/staging/speakup/serialio.c | 2 ++ drivers/staging/speakup/speakup_acntpc.c | 1 + drivers/staging/speakup/speakup_decpc.c | 1 + drivers/staging/speakup/speakup_dtlk.c | 1 + drivers/staging/speakup/speakup_keypc.c | 1 + drivers/staging/speakup/synth.c | 1 - 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c index d7736f7a35fe..b37d476f4c80 100644 --- a/drivers/staging/speakup/serialio.c +++ b/drivers/staging/speakup/serialio.c @@ -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); diff --git a/drivers/staging/speakup/speakup_acntpc.c b/drivers/staging/speakup/speakup_acntpc.c index 81dd0c0917dc..c5beb5602c42 100644 --- a/drivers/staging/speakup/speakup_acntpc.c +++ b/drivers/staging/speakup/speakup_acntpc.c @@ -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; diff --git a/drivers/staging/speakup/speakup_decpc.c b/drivers/staging/speakup/speakup_decpc.c index a4c5807b38de..2a738be19789 100644 --- a/drivers/staging/speakup/speakup_decpc.c +++ b/drivers/staging/speakup/speakup_decpc.c @@ -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; diff --git a/drivers/staging/speakup/speakup_dtlk.c b/drivers/staging/speakup/speakup_dtlk.c index e5a434376d35..279739a94c79 100644 --- a/drivers/staging/speakup/speakup_dtlk.c +++ b/drivers/staging/speakup/speakup_dtlk.c @@ -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; diff --git a/drivers/staging/speakup/speakup_keypc.c b/drivers/staging/speakup/speakup_keypc.c index 9eb9352e5db7..6649fa4c0ad2 100644 --- a/drivers/staging/speakup/speakup_keypc.c +++ b/drivers/staging/speakup/speakup_keypc.c @@ -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; diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c index 72d4f027e40a..989681dcb710 100644 --- a/drivers/staging/speakup/synth.c +++ b/drivers/staging/speakup/synth.c @@ -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; } -- 2.30.2