From 14f8d3ff3141caa8bf8326381ab8e6ce06c564b8 Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Mon, 6 Apr 2009 17:32:58 +0100 Subject: applicom: Auto-load applicom module when device opened. The applicom module is missing the char-major-10-157 alias that would cause it to be auto-loaded when a device of that type is opened. This patch adds the alias. Signed-off-by: Scott James Remnant Signed-off-by: Tim Gardner Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/char/applicom.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/char') diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c index 05674febb0c..73a0765344b 100644 --- a/drivers/char/applicom.c +++ b/drivers/char/applicom.c @@ -75,6 +75,7 @@ MODULE_DEVICE_TABLE(pci, applicom_pci_tbl); MODULE_AUTHOR("David Woodhouse & Applicom International"); MODULE_DESCRIPTION("Driver for Applicom Profibus card"); MODULE_LICENSE("GPL"); +MODULE_ALIAS_MISCDEV(AC_MINOR); MODULE_SUPPORTED_DEVICE("ac"); -- cgit v1.2.3-70-g09d2 From 9f56fad741163fe2111cbbcfb7ff795ebdabdab1 Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Mon, 6 Apr 2009 17:33:04 +0100 Subject: cyclades: Auto-load cyclades module when device opened. The cyclades module is missing the char-major-19-* alias that would cause it to be auto-loaded when a device of that type is opened. This patch adds the alias. Signed-off-by: Scott James Remnant Signed-off-by: Tim Gardner Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/char/cyclades.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/char') diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 272db0e2b49..1fdb9f657d8 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -646,6 +646,7 @@ #include #include #include +#include #include #include @@ -5408,3 +5409,4 @@ module_exit(cy_cleanup_module); MODULE_LICENSE("GPL"); MODULE_VERSION(CY_VERSION); +MODULE_ALIAS_CHARDEV_MAJOR(CYCLADES_MAJOR); -- cgit v1.2.3-70-g09d2 From 5350d3ba3d4cee899fa0b95fc0d30202ac8073e7 Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Mon, 6 Apr 2009 17:33:11 +0100 Subject: specialix: Auto-load specialix module when device opened. The specialix module is missing the char-major-75-* alias that would cause it to be auto-loaded when a device of that type is opened. This patch adds the alias. Signed-off-by: Scott James Remnant Signed-off-by: Tim Gardner Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/char/specialix.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/char') diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 3c67c3d83de..e72be4190a4 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c @@ -2365,3 +2365,4 @@ module_init(specialix_init_module); module_exit(specialix_exit_module); MODULE_LICENSE("GPL"); +MODULE_ALIAS_CHARDEV_MAJOR(SPECIALIX_NORMAL_MAJOR); -- cgit v1.2.3-70-g09d2 From 5c9f5806836a9079d6c2d38d567d5f0662863bf4 Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Mon, 6 Apr 2009 17:33:26 +0100 Subject: riscom8: Auto-load riscom8 module when device opened. The riscom8 module is missing the char-major-48-* alias that would cause it to be auto-loaded when a device of that type is opened. This patch adds the alias. Signed-off-by: Scott James Remnant Signed-off-by: Tim Gardner Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/char/riscom8.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/char') diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index 9af8d74875b..21766045123 100644 --- a/drivers/char/riscom8.c +++ b/drivers/char/riscom8.c @@ -48,6 +48,7 @@ #include #include #include +#include #include @@ -1524,6 +1525,7 @@ module_param(iobase2, int, 0); module_param(iobase3, int, 0); MODULE_LICENSE("GPL"); +MODULE_ALIAS_CHARDEV_MAJOR(RISCOM8_NORMAL_MAJOR); #endif /* MODULE */ /* -- cgit v1.2.3-70-g09d2 From bbb8e6bf10c5c3c9c70a94aa26cb27f95f10dee5 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 6 Apr 2009 17:33:55 +0100 Subject: isicom: isicom kref leak fix The isicom driver leaks a kref on the shutdown path. Drop the additional kref we took Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/char/isicom.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/char') diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index 24aa6e88e22..a59eac584d1 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c @@ -925,6 +925,7 @@ static void isicom_shutdown_port(struct isi_port *port) if (!card->count) isicom_shutdown_board(card); } + tty_kref_put(tty); } static void isicom_flush_buffer(struct tty_struct *tty) -- cgit v1.2.3-70-g09d2 From 0e0fd7d73ed130583dca16405b029f56bf65109f Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 6 Apr 2009 17:34:04 +0100 Subject: tty: moxa, fix refcounting in moxa_poll_port There is missing tty_kref_put on some paths in moxa_poll_port, although the reference is always taken. Fix it. Signed-off-by: Jiri Slaby Reported-by: Jan 'Yenya' Kasprzak Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/char/moxa.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c index 8b0da97d529..4a4cab73d0b 100644 --- a/drivers/char/moxa.c +++ b/drivers/char/moxa.c @@ -1486,11 +1486,11 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle, } if (!handle) /* nothing else to do */ - return 0; + goto put; intr = readw(ip); /* port irq status */ if (intr == 0) - return 0; + goto put; writew(0, ip); /* ACK port */ ofsAddr = p->tableAddr; @@ -1499,16 +1499,17 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle, ofsAddr + HostStat); if (!inited) - return 0; + goto put; if (tty && (intr & IntrBreak) && !I_IGNBRK(tty)) { /* BREAK */ tty_insert_flip_char(tty, 0, TTY_BREAK); tty_schedule_flip(tty); } - tty_kref_put(tty); if (intr & IntrLine) moxa_new_dcdstate(p, readb(ofsAddr + FlagStat) & DCD_state); +put: + tty_kref_put(tty); return 0; } -- cgit v1.2.3-70-g09d2 From 0326e6d596491db64d787136cbd703bde0ee8d77 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 6 Apr 2009 17:34:10 +0100 Subject: mxser: remove tty_port_tty_get from mxser_check_modem_status mxser_check_modem_status is called with tty parameter, so the reference should be increased by callers already -- for ioctl syscall it is held whole time gap since open to close, for interrupt, the reference count is increased in the irq handler. There is no tty_kref_put in that function, so this also fixes a refcounting bug. Signed-off-by: Jiri Slaby Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/char/mxser.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/char') diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 402c9f217f8..a420e8d437d 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -820,7 +820,6 @@ static void mxser_check_modem_status(struct tty_struct *tty, wake_up_interruptible(&port->port.open_wait); } - tty = tty_port_tty_get(&port->port); if (port->port.flags & ASYNC_CTS_FLOW) { if (tty->hw_stopped) { if (status & UART_MSR_CTS) { -- cgit v1.2.3-70-g09d2 From 1f85449ffd146cf2b91a47dff694281bcfd2558b Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Mon, 6 Apr 2009 17:35:34 +0100 Subject: rio: addition has higher precedence than ?: Signed-off-by: Roel Kluin Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/char/rio/rio_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/char') diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c index 2e8a6eed34b..ce81da5b2da 100644 --- a/drivers/char/rio/rio_linux.c +++ b/drivers/char/rio/rio_linux.c @@ -333,7 +333,7 @@ void rio_copy_to_card(void *from, void __iomem *to, int len) int rio_minor(struct tty_struct *tty) { - return tty->index + (tty->driver == rio_driver) ? 0 : 256; + return tty->index + ((tty->driver == rio_driver) ? 0 : 256); } static int rio_set_real_termios(void *ptr) -- cgit v1.2.3-70-g09d2