From: covici@ccs.covici.com
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
William Hubbs <w.d.hubbs@gmail.com>,
Chris Brannon <chris@the-brannons.com>,
Kirk Reiser <kirk@reisers.ca>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
speakup@linux-speakup.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging: speakup: Fix getting port information
Date: Sat, 02 Jan 2016 19:10:36 -0500 [thread overview]
Message-ID: <15457.1451779836@ccs.covici.com> (raw)
In-Reply-To: <20160102232529.GC2860@var.home>
I had a patch which also worked, but yours may be better -- I enclose it
here for your information.
--- drivers/staging/speakup/serialio.h.old 2015-08-30 14:34:09.000000000 -0400
+++ drivers/staging/speakup/serialio.h 2015-10-07 06:27:04.880829874 -0400
@@ -1,22 +1,24 @@
#ifndef _SPEAKUP_SERIAL_H
#define _SPEAKUP_SERIAL_H
+#include <linux/serial_core.h>
#include <linux/serial.h> /* for rs_table, serial constants */
#include <linux/serial_reg.h> /* for more serial constants */
#ifndef __sparc__
-#include <linux/serial.h>
+#include <asm/serial.h>
#endif
/*
* this is cut&paste from 8250.h. Get rid of the structure, the definitions
* and this whole broken driver.
*/
+
struct old_serial_port {
unsigned int uart; /* unused */
unsigned int baud_base;
unsigned int port;
unsigned int irq;
- unsigned int flags; /* unused */
+ upf_t flags; /*unused*/
};
/* countdown values for serial timeouts in us */
@@ -34,7 +36,6 @@
#define SPK_TIMEOUT 100
#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
-#define spk_serial_tx_busy() \
- ((inb(speakup_info.port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY)
+#define spk_serial_tx_busy() ((inb(speakup_info.port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY)
#endif
Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
> 5e6dc54 broke the port information in the speakup driver:
> SERIAL_PORT_DFNS only gets defined if asm/serial.h is included.
>
> Along the way, make sure that we do have information for the requested
> serial port number (index)
>
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
>
> --- a/drivers/staging/speakup/serialio.c
> +++ b/drivers/staging/speakup/serialio.c
> @@ -6,6 +6,9 @@
> #include "spk_priv.h"
> #include "serialio.h"
>
> +#include <linux/serial_core.h>
> +#include <asm/serial.h>
> +
> #ifndef SERIAL_PORT_DFNS
> #define SERIAL_PORT_DFNS
> #endif
> @@ -26,6 +29,11 @@ const struct old_serial_port *spk_serial
> const struct old_serial_port *ser = rs_table + index;
> int err;
>
> + if (index > sizeof(rs_table) / sizeof(*rs_table)) {
> + pr_info("no port info for ttyS%d\n", index);
> + return NULL;
> + }
> +
> /* Divisor, bytesize and parity */
> quot = ser->baud_base / baud;
> cval = cflag & (CSIZE | CSTOPB);
> _______________________________________________
> Speakup mailing list
> Speakup@linux-speakup.org
> http://linux-speakup.org/cgi-bin/mailman/listinfo/speakup
>
--
Your life is like a penny. You're going to lose it. The question is:
How do
you spend it?
John Covici
covici@ccs.covici.com
next prev parent reply other threads:[~2016-01-03 0:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-02 23:25 Samuel Thibault
2016-01-02 23:49 ` Samuel Thibault
2016-01-03 0:10 ` covici [this message]
2016-01-03 0:56 ` Samuel Thibault
2016-01-03 1:31 ` covici
2016-01-04 12:22 ` Dan Carpenter
2016-01-04 12:26 ` Dan Carpenter
2016-01-04 12:20 ` Dan Carpenter
2016-01-05 1:14 ` Samuel Thibault
2016-01-05 1:19 Samuel Thibault
2016-01-05 9:36 ` Dan Carpenter
2016-01-14 23:47 Samuel Thibault
2016-01-15 5:59 ` Dan Carpenter
2016-01-25 0:29 ` Samuel Thibault
2016-01-25 2:52 ` Greg Kroah-Hartman
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=15457.1451779836@ccs.covici.com \
--to=covici@ccs.covici.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome