Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1300157

Re: [PATCH] Staging: speakup: Fix getting port information

From covici@ccs.covici.com
Newsgroups linux.kernel
Subject Re: [PATCH] Staging: speakup: Fix getting port information
Date 2016-01-03 01:50 +0100
Message-ID <qMF1U-6JI-11@gated-at.bofh.it> (permalink)
References <qMDW9-67v-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] Staging: speakup: Fix getting port information Samuel Thibault <samuel.thibault@ens-lyon.org> - 2016-01-03 00:40 +0100
  Re: [PATCH] Staging: speakup: Fix getting port information Samuel Thibault <samuel.thibault@ens-lyon.org> - 2016-01-03 00:50 +0100
  Re: [PATCH] Staging: speakup: Fix getting port information covici@ccs.covici.com - 2016-01-03 01:50 +0100
    Re: [PATCH] Staging: speakup: Fix getting port information Samuel Thibault <samuel.thibault@ens-lyon.org> - 2016-01-03 02:10 +0100
      Re: [PATCH] Staging: speakup: Fix getting port information covici@ccs.covici.com - 2016-01-03 02:40 +0100
      Re: [PATCH] Staging: speakup: Fix getting port information Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-04 13:30 +0100
        Re: [PATCH] Staging: speakup: Fix getting port information Samuel Thibault <samuel.thibault@ens-lyon.org> - 2016-01-05 02:30 +0100
      Re: [PATCH] Staging: speakup: Fix getting port information Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-04 13:30 +0100
  Re: [PATCH] Staging: speakup: Fix getting port information Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-04 13:30 +0100

csiph-web