Skip to content

Commit

Permalink
Merge tag 'tty-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…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 <[email protected]>"

* 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
  • Loading branch information
torvalds committed Oct 19, 2012
2 parents 42bf3e2 + 178e485 commit ccfc273
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 31 deletions.
1 change: 1 addition & 0 deletions drivers/staging/dgrp/dgrp_mon_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <linux/sched.h>
#include <asm/unaligned.h>
#include <linux/proc_fs.h>
#include <linux/uaccess.h>

#include "dgrp_common.h"

Expand Down
7 changes: 7 additions & 0 deletions drivers/staging/dgrp/dgrp_specproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <linux/proc_fs.h>
#include <linux/ctype.h>
#include <linux/seq_file.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>

#include "dgrp_common.h"
Expand Down Expand Up @@ -228,6 +229,9 @@ static void register_proc_table(struct dgrp_proc_entry *table,
int len;
mode_t mode;

if (table == NULL)
return;

for (; table->id; table++) {
/* Can't do anything without a proc name. */
if (!table->name)
Expand Down Expand Up @@ -296,6 +300,9 @@ static void unregister_proc_table(struct dgrp_proc_entry *table,
struct proc_dir_entry *de;
struct nd_struct *tmp;

if (table == NULL)
return;

list_for_each_entry(tmp, &nd_struct_list, list) {
if ((table == dgrp_net_table) && (tmp->nd_net_de)) {
unregister_dgrp_device(tmp->nd_net_de);
Expand Down
10 changes: 10 additions & 0 deletions drivers/staging/dgrp/dgrp_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/sched.h>
#include <linux/uaccess.h>

#include "dgrp_common.h"

Expand Down Expand Up @@ -3172,6 +3173,9 @@ dgrp_tty_init(struct nd_struct *nd)
*/

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);

nd->nd_serial_ttdriver->owner = THIS_MODULE;
Expand Down Expand Up @@ -3231,6 +3235,9 @@ dgrp_tty_init(struct nd_struct *nd)
}

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);

nd->nd_callout_ttdriver->owner = THIS_MODULE;
Expand Down Expand Up @@ -3268,6 +3275,9 @@ dgrp_tty_init(struct nd_struct *nd)


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);

nd->nd_xprint_ttdriver->owner = THIS_MODULE;
Expand Down
20 changes: 10 additions & 10 deletions drivers/tty/serial/8250/8250_hp300.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int __init hp300_setup_serial_console(void)
static int __devinit hpdca_init_one(struct dio_dev *d,
const struct dio_device_id *ent)
{
struct uart_port port;
struct uart_8250_port uart;
int line;

#ifdef CONFIG_SERIAL_8250_CONSOLE
Expand All @@ -174,19 +174,19 @@ static int __devinit hpdca_init_one(struct dio_dev *d,
memset(&uart, 0, sizeof(uart));

/* Memory mapped I/O */
port.iotype = UPIO_MEM;
port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
port.irq = d->ipl;
port.uartclk = HPDCA_BAUD_BASE * 16;
port.mapbase = (d->resource.start + UART_OFFSET);
port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE);
port.regshift = 1;
port.dev = &d->dev;
uart.port.iotype = UPIO_MEM;
uart.port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
uart.port.irq = d->ipl;
uart.port.uartclk = HPDCA_BAUD_BASE * 16;
uart.port.mapbase = (d->resource.start + UART_OFFSET);
uart.port.membase = (char *)(uart.port.mapbase + DIO_VIRADDRBASE);
uart.port.regshift = 1;
uart.port.dev = &d->dev;
line = serial8250_register_8250_port(&uart);

if (line < 0) {
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;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/tty/serial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ config SERIAL_SC26XX_CONSOLE
Support for Console on SC2681/SC2692 serial ports.

config SERIAL_SCCNXP
bool "SCCNXP serial port support"
tristate "SCCNXP serial port support"
depends on !SERIAL_SC26XX
select SERIAL_CORE
default n
Expand All @@ -1162,7 +1162,7 @@ config SERIAL_SCCNXP

config SERIAL_SCCNXP_CONSOLE
bool "Console on SCCNXP serial port"
depends on SERIAL_SCCNXP
depends on SERIAL_SCCNXP=y
select SERIAL_CORE_CONSOLE
help
Support for console on SCCNXP serial ports.
Expand Down
1 change: 1 addition & 0 deletions drivers/tty/serial/sccnxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ static const struct platform_device_id sccnxp_id_table[] = {
{ "sc28202", SCCNXP_TYPE_SC28202 },
{ "sc68681", SCCNXP_TYPE_SC68681 },
{ "sc68692", SCCNXP_TYPE_SC68692 },
{ },
};
MODULE_DEVICE_TABLE(platform, sccnxp_id_table);

Expand Down
1 change: 0 additions & 1 deletion include/linux/hsi/Kbuild
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
header-y += hsi_char.h
27 changes: 9 additions & 18 deletions include/linux/ratelimit.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,27 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
#define WARN_ON_RATELIMIT(condition, state) \
WARN_ON((condition) && __ratelimit(state))

#define __WARN_RATELIMIT(condition, state, format...) \
({ \
int rtn = 0; \
if (unlikely(__ratelimit(state))) \
rtn = WARN(condition, format); \
rtn; \
})

#define WARN_RATELIMIT(condition, format...) \
#define WARN_RATELIMIT(condition, format, ...) \
({ \
static DEFINE_RATELIMIT_STATE(_rs, \
DEFAULT_RATELIMIT_INTERVAL, \
DEFAULT_RATELIMIT_BURST); \
__WARN_RATELIMIT(condition, &_rs, format); \
int rtn = !!(condition); \
\
if (unlikely(rtn && __ratelimit(&_rs))) \
WARN(rtn, format, ##__VA_ARGS__); \
\
rtn; \
})

#else

#define WARN_ON_RATELIMIT(condition, state) \
WARN_ON(condition)

#define __WARN_RATELIMIT(condition, state, format...) \
({ \
int rtn = WARN(condition, format); \
rtn; \
})

#define WARN_RATELIMIT(condition, format...) \
#define WARN_RATELIMIT(condition, format, ...) \
({ \
int rtn = WARN(condition, format); \
int rtn = WARN(condition, format, ##__VA_ARGS__); \
rtn; \
})

Expand Down
1 change: 1 addition & 0 deletions include/uapi/linux/hsi/Kbuild
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# UAPI Header export list
header-y += hsi_char.h
File renamed without changes.
2 changes: 2 additions & 0 deletions net/irda/ircomm/ircomm_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

tty->driver_data = self;

return tty_port_install(&self->port, driver, tty);
}

Expand Down

0 comments on commit ccfc273

Please sign in to comment.