All of lore.kernel.org
 help / color / mirror / Atom feed
From: Okash Khawaja <okash.khawaja@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	linux-kernel@vger.kernel.org
Cc: William Hubbs <w.d.hubbs@gmail.com>,
	Chris Brannon <chris@the-brannons.com>,
	Kirk Reiser <kirk@reisers.ca>,
	speakup@linux-speakup.org, devel@driverdev.osuosl.org,
	Okash Khawaja <okash.khawaja@gmail.com>
Subject: [patch 3/4] staging: speakup: move spk_stop_serial_interrupt into synth-specific release function
Date: Tue, 14 Mar 2017 13:41:54 +0000	[thread overview]
Message-ID: <20170314134521.466524315@gmail.com> (raw)
In-Reply-To: 20170314134151.603195427@gmail.com

[-- Attachment #1: 03_refactor_spk_stop_serial_interrupt --]
[-- Type: text/plain, Size: 3405 bytes --]

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>

Index: linux-4.11-rc2/drivers/staging/speakup/serialio.c
===================================================================
--- linux-4.11-rc2.orig/drivers/staging/speakup/serialio.c
+++ linux-4.11-rc2/drivers/staging/speakup/serialio.c
@@ -149,6 +149,7 @@
 	/* 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)
 {
@@ -224,6 +225,7 @@
 
 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: linux-4.11-rc2/drivers/staging/speakup/speakup_acntpc.c
===================================================================
--- linux-4.11-rc2.orig/drivers/staging/speakup/speakup_acntpc.c
+++ linux-4.11-rc2/drivers/staging/speakup/speakup_acntpc.c
@@ -303,6 +303,7 @@
 
 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: linux-4.11-rc2/drivers/staging/speakup/synth.c
===================================================================
--- linux-4.11-rc2.orig/drivers/staging/speakup/synth.c
+++ linux-4.11-rc2/drivers/staging/speakup/synth.c
@@ -432,7 +432,6 @@
 		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;
 }
Index: linux-4.11-rc2/drivers/staging/speakup/speakup_decpc.c
===================================================================
--- linux-4.11-rc2.orig/drivers/staging/speakup/speakup_decpc.c
+++ linux-4.11-rc2/drivers/staging/speakup/speakup_decpc.c
@@ -482,6 +482,7 @@
 
 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: linux-4.11-rc2/drivers/staging/speakup/speakup_dtlk.c
===================================================================
--- linux-4.11-rc2.orig/drivers/staging/speakup/speakup_dtlk.c
+++ linux-4.11-rc2/drivers/staging/speakup/speakup_dtlk.c
@@ -374,6 +374,7 @@
 
 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: linux-4.11-rc2/drivers/staging/speakup/speakup_keypc.c
===================================================================
--- linux-4.11-rc2.orig/drivers/staging/speakup/speakup_keypc.c
+++ linux-4.11-rc2/drivers/staging/speakup/speakup_keypc.c
@@ -305,6 +305,7 @@
 
 static void keynote_release(void)
 {
+	spk_stop_serial_interrupt();
 	if (synth_port)
 		synth_release_region(synth_port, SYNTH_IO_EXTENT);
 	synth_port = 0;

  parent reply	other threads:[~2017-03-14 13:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14 13:41 [patch 0/4] staging: speakup: refactor to make raw serial i/o swappable Okash Khawaja
2017-03-14 13:41 ` [patch 1/4] staging: speakup: spk_serial_out and spk_wait_for_xmitr to take synth arg Okash Khawaja
2017-03-14 13:41 ` [patch 2/4] staging: serial: add spk_io_ops struct to spk_synth Okash Khawaja
2017-03-14 13:41 ` Okash Khawaja [this message]
2017-03-14 13:41 ` [patch 4/4] staging: speakup: move those functions which do outgoing serial comms, into serialio.c Okash Khawaja
2017-03-16  2:14   ` Greg Kroah-Hartman
2017-03-16  6:51     ` Okash Khawaja
2017-03-16  7:01       ` Greg Kroah-Hartman
2017-03-16  8:10         ` Okash Khawaja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170314134521.466524315@gmail.com \
    --to=okash.khawaja@gmail.com \
    --cc=chris@the-brannons.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kirk@reisers.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=speakup@linux-speakup.org \
    --cc=w.d.hubbs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.