lkml.org 
[lkml]   [2016]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Staging: speakup: Fix getting port information
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);

\
 
 \ /
  Last update: 2016-01-03 01:01    [W:0.520 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site