From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751970AbcACArs (ORCPT ); Sat, 2 Jan 2016 19:47:48 -0500 Received: from mail0200.smtp25.com ([174.37.170.200]:35966 "EHLO mail0200.smtp25.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751415AbcACArq convert rfc822-to-8bit (ORCPT ); Sat, 2 Jan 2016 19:47:46 -0500 X-Greylist: delayed 2205 seconds by postgrey-1.27 at vger.kernel.org; Sat, 02 Jan 2016 19:47:46 EST From: covici@ccs.covici.com To: Samuel Thibault , William Hubbs , Chris Brannon , Kirk Reiser , Greg Kroah-Hartman , speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Mail-Followup-To: Samuel Thibault , William Hubbs , Chris Brannon , Kirk Reiser , Greg Kroah-Hartman , speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Staging: speakup: Fix getting port information In-reply-to: <20160102232529.GC2860@var.home> References: <20160102232529.GC2860@var.home> Comments: In-reply-to Samuel Thibault message dated "Sun, 03 Jan 2016 00:25:29 +0100." X-Mailer: MH-E 8.5; nmh 1.6; GNU Emacs 23.4.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15456.1451779836.1@ccs.covici.com> Content-Transfer-Encoding: 8BIT Date: Sat, 02 Jan 2016 19:10:36 -0500 Message-ID: <15457.1451779836@ccs.covici.com> X-SpamH-OriginatingIP: 70.109.53.110 X-SpamH-Filter: s-out-001.smtp25.com-u030AbjE008789 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 #include /* for rs_table, serial constants */ #include /* for more serial constants */ #ifndef __sparc__ -#include +#include #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 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 > > --- a/drivers/staging/speakup/serialio.c > +++ b/drivers/staging/speakup/serialio.c > @@ -6,6 +6,9 @@ > #include "spk_priv.h" > #include "serialio.h" > > +#include > +#include > + > #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