Commit ccfc2730 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'tty-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull TTY fixes from Greg Kroah-Hartman:
 "Here are some tty and serial driver fixes for your 3.7-rc1 tree.

  Again, the UABI header file fixes, and a number of build and runtime
  serial driver bugfixes that solve problems people have been reporting
  (the staging driver is a tty driver, hence the fixes coming in through
  this tree.)

  All of these have been in the linux-next tree for a while.

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'tty-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  staging: dgrp: check return value of alloc_tty_driver
  staging: dgrp: check for NULL pointer in (un)register_proc_table
  serial/8250_hp300: Missing 8250 register interface conversion bits
  UAPI: (Scripted) Disintegrate include/linux/hsi
  tty: serial: sccnxp: Fix bug with unterminated platform_id list
  staging: serial: dgrp: Add missing #include <linux/uaccess.h>
  serial: sccnxp: Allows the driver to be compiled as a module
  tty: Fix bogus "callbacks suppressed" messages
  net, TTY: initialize tty->driver_data before usage
parents 42bf3e27 178e485a
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/uaccess.h>
#include "dgrp_common.h" #include "dgrp_common.h"
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include "dgrp_common.h" #include "dgrp_common.h"
...@@ -228,6 +229,9 @@ static void register_proc_table(struct dgrp_proc_entry *table, ...@@ -228,6 +229,9 @@ static void register_proc_table(struct dgrp_proc_entry *table,
int len; int len;
mode_t mode; mode_t mode;
if (table == NULL)
return;
for (; table->id; table++) { for (; table->id; table++) {
/* Can't do anything without a proc name. */ /* Can't do anything without a proc name. */
if (!table->name) if (!table->name)
...@@ -296,6 +300,9 @@ static void unregister_proc_table(struct dgrp_proc_entry *table, ...@@ -296,6 +300,9 @@ static void unregister_proc_table(struct dgrp_proc_entry *table,
struct proc_dir_entry *de; struct proc_dir_entry *de;
struct nd_struct *tmp; struct nd_struct *tmp;
if (table == NULL)
return;
list_for_each_entry(tmp, &nd_struct_list, list) { list_for_each_entry(tmp, &nd_struct_list, list) {
if ((table == dgrp_net_table) && (tmp->nd_net_de)) { if ((table == dgrp_net_table) && (tmp->nd_net_de)) {
unregister_dgrp_device(tmp->nd_net_de); unregister_dgrp_device(tmp->nd_net_de);
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/tty_flip.h> #include <linux/tty_flip.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/uaccess.h>
#include "dgrp_common.h" #include "dgrp_common.h"
...@@ -3172,6 +3173,9 @@ dgrp_tty_init(struct nd_struct *nd) ...@@ -3172,6 +3173,9 @@ dgrp_tty_init(struct nd_struct *nd)
*/ */
nd->nd_serial_ttdriver = alloc_tty_driver(CHAN_MAX); nd->nd_serial_ttdriver = alloc_tty_driver(CHAN_MAX);
if (!nd->nd_serial_ttdriver)
return -ENOMEM;
sprintf(nd->nd_serial_name, "tty_dgrp_%s_", id); sprintf(nd->nd_serial_name, "tty_dgrp_%s_", id);
nd->nd_serial_ttdriver->owner = THIS_MODULE; nd->nd_serial_ttdriver->owner = THIS_MODULE;
...@@ -3231,6 +3235,9 @@ dgrp_tty_init(struct nd_struct *nd) ...@@ -3231,6 +3235,9 @@ dgrp_tty_init(struct nd_struct *nd)
} }
nd->nd_callout_ttdriver = alloc_tty_driver(CHAN_MAX); nd->nd_callout_ttdriver = alloc_tty_driver(CHAN_MAX);
if (!nd->nd_callout_ttdriver)
return -ENOMEM;
sprintf(nd->nd_callout_name, "cu_dgrp_%s_", id); sprintf(nd->nd_callout_name, "cu_dgrp_%s_", id);
nd->nd_callout_ttdriver->owner = THIS_MODULE; nd->nd_callout_ttdriver->owner = THIS_MODULE;
...@@ -3268,6 +3275,9 @@ dgrp_tty_init(struct nd_struct *nd) ...@@ -3268,6 +3275,9 @@ dgrp_tty_init(struct nd_struct *nd)
nd->nd_xprint_ttdriver = alloc_tty_driver(CHAN_MAX); nd->nd_xprint_ttdriver = alloc_tty_driver(CHAN_MAX);
if (!nd->nd_xprint_ttdriver)
return -ENOMEM;
sprintf(nd->nd_xprint_name, "pr_dgrp_%s_", id); sprintf(nd->nd_xprint_name, "pr_dgrp_%s_", id);
nd->nd_xprint_ttdriver->owner = THIS_MODULE; nd->nd_xprint_ttdriver->owner = THIS_MODULE;
......
...@@ -162,7 +162,7 @@ int __init hp300_setup_serial_console(void) ...@@ -162,7 +162,7 @@ int __init hp300_setup_serial_console(void)
static int __devinit hpdca_init_one(struct dio_dev *d, static int __devinit hpdca_init_one(struct dio_dev *d,
const struct dio_device_id *ent) const struct dio_device_id *ent)
{ {
struct uart_port port; struct uart_8250_port uart;
int line; int line;
#ifdef CONFIG_SERIAL_8250_CONSOLE #ifdef CONFIG_SERIAL_8250_CONSOLE
...@@ -174,19 +174,19 @@ static int __devinit hpdca_init_one(struct dio_dev *d, ...@@ -174,19 +174,19 @@ static int __devinit hpdca_init_one(struct dio_dev *d,
memset(&uart, 0, sizeof(uart)); memset(&uart, 0, sizeof(uart));
/* Memory mapped I/O */ /* Memory mapped I/O */
port.iotype = UPIO_MEM; uart.port.iotype = UPIO_MEM;
port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; uart.port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
port.irq = d->ipl; uart.port.irq = d->ipl;
port.uartclk = HPDCA_BAUD_BASE * 16; uart.port.uartclk = HPDCA_BAUD_BASE * 16;
port.mapbase = (d->resource.start + UART_OFFSET); uart.port.mapbase = (d->resource.start + UART_OFFSET);
port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE); uart.port.membase = (char *)(uart.port.mapbase + DIO_VIRADDRBASE);
port.regshift = 1; uart.port.regshift = 1;
port.dev = &d->dev; uart.port.dev = &d->dev;
line = serial8250_register_8250_port(&uart); line = serial8250_register_8250_port(&uart);
if (line < 0) { if (line < 0) {
printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d" printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d"
" irq %d failed\n", d->scode, port.irq); " irq %d failed\n", d->scode, uart.port.irq);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -1150,7 +1150,7 @@ config SERIAL_SC26XX_CONSOLE ...@@ -1150,7 +1150,7 @@ config SERIAL_SC26XX_CONSOLE
Support for Console on SC2681/SC2692 serial ports. Support for Console on SC2681/SC2692 serial ports.
config SERIAL_SCCNXP config SERIAL_SCCNXP
bool "SCCNXP serial port support" tristate "SCCNXP serial port support"
depends on !SERIAL_SC26XX depends on !SERIAL_SC26XX
select SERIAL_CORE select SERIAL_CORE
default n default n
...@@ -1162,7 +1162,7 @@ config SERIAL_SCCNXP ...@@ -1162,7 +1162,7 @@ config SERIAL_SCCNXP
config SERIAL_SCCNXP_CONSOLE config SERIAL_SCCNXP_CONSOLE
bool "Console on SCCNXP serial port" bool "Console on SCCNXP serial port"
depends on SERIAL_SCCNXP depends on SERIAL_SCCNXP=y
select SERIAL_CORE_CONSOLE select SERIAL_CORE_CONSOLE
help help
Support for console on SCCNXP serial ports. Support for console on SCCNXP serial ports.
......
...@@ -971,6 +971,7 @@ static const struct platform_device_id sccnxp_id_table[] = { ...@@ -971,6 +971,7 @@ static const struct platform_device_id sccnxp_id_table[] = {
{ "sc28202", SCCNXP_TYPE_SC28202 }, { "sc28202", SCCNXP_TYPE_SC28202 },
{ "sc68681", SCCNXP_TYPE_SC68681 }, { "sc68681", SCCNXP_TYPE_SC68681 },
{ "sc68692", SCCNXP_TYPE_SC68692 }, { "sc68692", SCCNXP_TYPE_SC68692 },
{ },
}; };
MODULE_DEVICE_TABLE(platform, sccnxp_id_table); MODULE_DEVICE_TABLE(platform, sccnxp_id_table);
......
...@@ -46,20 +46,17 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func); ...@@ -46,20 +46,17 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
#define WARN_ON_RATELIMIT(condition, state) \ #define WARN_ON_RATELIMIT(condition, state) \
WARN_ON((condition) && __ratelimit(state)) WARN_ON((condition) && __ratelimit(state))
#define __WARN_RATELIMIT(condition, state, format...) \ #define WARN_RATELIMIT(condition, format, ...) \
({ \
int rtn = 0; \
if (unlikely(__ratelimit(state))) \
rtn = WARN(condition, format); \
rtn; \
})
#define WARN_RATELIMIT(condition, format...) \
({ \ ({ \
static DEFINE_RATELIMIT_STATE(_rs, \ static DEFINE_RATELIMIT_STATE(_rs, \
DEFAULT_RATELIMIT_INTERVAL, \ DEFAULT_RATELIMIT_INTERVAL, \
DEFAULT_RATELIMIT_BURST); \ DEFAULT_RATELIMIT_BURST); \
__WARN_RATELIMIT(condition, &_rs, format); \ int rtn = !!(condition); \
\
if (unlikely(rtn && __ratelimit(&_rs))) \
WARN(rtn, format, ##__VA_ARGS__); \
\
rtn; \
}) })
#else #else
...@@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func); ...@@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
#define WARN_ON_RATELIMIT(condition, state) \ #define WARN_ON_RATELIMIT(condition, state) \
WARN_ON(condition) WARN_ON(condition)
#define __WARN_RATELIMIT(condition, state, format...) \ #define WARN_RATELIMIT(condition, format, ...) \
({ \
int rtn = WARN(condition, format); \
rtn; \
})
#define WARN_RATELIMIT(condition, format...) \
({ \ ({ \
int rtn = WARN(condition, format); \ int rtn = WARN(condition, format, ##__VA_ARGS__); \
rtn; \ rtn; \
}) })
......
# UAPI Header export list # UAPI Header export list
header-y += hsi_char.h
...@@ -421,6 +421,8 @@ static int ircomm_tty_install(struct tty_driver *driver, struct tty_struct *tty) ...@@ -421,6 +421,8 @@ static int ircomm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
hashbin_insert(ircomm_tty, (irda_queue_t *) self, line, NULL); hashbin_insert(ircomm_tty, (irda_queue_t *) self, line, NULL);
} }
tty->driver_data = self;
return tty_port_install(&self->port, driver, tty); return tty_port_install(&self->port, driver, tty);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment