diff options
Diffstat (limited to 'drivers/tty/serial/jsm/jsm_tty.c')
-rw-r--r-- | drivers/tty/serial/jsm/jsm_tty.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c index ec7d8383900f..469927d37b41 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c | |||
@@ -1,18 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /************************************************************************ | 2 | /************************************************************************ |
2 | * Copyright 2003 Digi International (www.digi.com) | 3 | * Copyright 2003 Digi International (www.digi.com) |
3 | * | 4 | * |
4 | * Copyright (C) 2004 IBM Corporation. All rights reserved. | 5 | * Copyright (C) 2004 IBM Corporation. All rights reserved. |
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2, or (at your option) | ||
9 | * any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the | ||
13 | * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | ||
14 | * PURPOSE. See the GNU General Public License for more details. | ||
15 | * | ||
16 | * Contact Information: | 7 | * Contact Information: |
17 | * Scott H Kilau <Scott_Kilau@digi.com> | 8 | * Scott H Kilau <Scott_Kilau@digi.com> |
18 | * Ananda Venkatarman <mansarov@us.ibm.com> | 9 | * Ananda Venkatarman <mansarov@us.ibm.com> |
@@ -36,7 +27,7 @@ static void jsm_carrier(struct jsm_channel *ch); | |||
36 | static inline int jsm_get_mstat(struct jsm_channel *ch) | 27 | static inline int jsm_get_mstat(struct jsm_channel *ch) |
37 | { | 28 | { |
38 | unsigned char mstat; | 29 | unsigned char mstat; |
39 | unsigned result; | 30 | int result; |
40 | 31 | ||
41 | jsm_dbg(IOCTL, &ch->ch_bd->pci_dev, "start\n"); | 32 | jsm_dbg(IOCTL, &ch->ch_bd->pci_dev, "start\n"); |
42 | 33 | ||
@@ -124,6 +115,7 @@ static void jsm_tty_set_mctrl(struct uart_port *port, unsigned int mctrl) | |||
124 | static void jsm_tty_write(struct uart_port *port) | 115 | static void jsm_tty_write(struct uart_port *port) |
125 | { | 116 | { |
126 | struct jsm_channel *channel; | 117 | struct jsm_channel *channel; |
118 | |||
127 | channel = container_of(port, struct jsm_channel, uart_port); | 119 | channel = container_of(port, struct jsm_channel, uart_port); |
128 | channel->ch_bd->bd_ops->copy_data_from_queue_to_uart(channel); | 120 | channel->ch_bd->bd_ops->copy_data_from_queue_to_uart(channel); |
129 | } | 121 | } |
@@ -275,14 +267,12 @@ static int jsm_tty_open(struct uart_port *port) | |||
275 | static void jsm_tty_close(struct uart_port *port) | 267 | static void jsm_tty_close(struct uart_port *port) |
276 | { | 268 | { |
277 | struct jsm_board *bd; | 269 | struct jsm_board *bd; |
278 | struct ktermios *ts; | ||
279 | struct jsm_channel *channel = | 270 | struct jsm_channel *channel = |
280 | container_of(port, struct jsm_channel, uart_port); | 271 | container_of(port, struct jsm_channel, uart_port); |
281 | 272 | ||
282 | jsm_dbg(CLOSE, &channel->ch_bd->pci_dev, "start\n"); | 273 | jsm_dbg(CLOSE, &channel->ch_bd->pci_dev, "start\n"); |
283 | 274 | ||
284 | bd = channel->ch_bd; | 275 | bd = channel->ch_bd; |
285 | ts = &port->state->port.tty->termios; | ||
286 | 276 | ||
287 | channel->ch_flags &= ~(CH_STOPI); | 277 | channel->ch_flags &= ~(CH_STOPI); |
288 | 278 | ||
@@ -473,12 +463,11 @@ int jsm_uart_port_init(struct jsm_board *brd) | |||
473 | } else | 463 | } else |
474 | set_bit(line, linemap); | 464 | set_bit(line, linemap); |
475 | brd->channels[i]->uart_port.line = line; | 465 | brd->channels[i]->uart_port.line = line; |
476 | rc = uart_add_one_port (&jsm_uart_driver, &brd->channels[i]->uart_port); | 466 | rc = uart_add_one_port(&jsm_uart_driver, &brd->channels[i]->uart_port); |
477 | if (rc){ | 467 | if (rc) { |
478 | printk(KERN_INFO "jsm: Port %d failed. Aborting...\n", i); | 468 | printk(KERN_INFO "jsm: Port %d failed. Aborting...\n", i); |
479 | return rc; | 469 | return rc; |
480 | } | 470 | } else |
481 | else | ||
482 | printk(KERN_INFO "jsm: Port %d added\n", i); | 471 | printk(KERN_INFO "jsm: Port %d added\n", i); |
483 | } | 472 | } |
484 | 473 | ||
@@ -541,7 +530,7 @@ void jsm_input(struct jsm_channel *ch) | |||
541 | tp = port->tty; | 530 | tp = port->tty; |
542 | 531 | ||
543 | bd = ch->ch_bd; | 532 | bd = ch->ch_bd; |
544 | if(!bd) | 533 | if (!bd) |
545 | return; | 534 | return; |
546 | 535 | ||
547 | spin_lock_irqsave(&ch->ch_lock, lock_flags); | 536 | spin_lock_irqsave(&ch->ch_lock, lock_flags); |
@@ -781,7 +770,7 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch) | |||
781 | if (qleft < 256) { | 770 | if (qleft < 256) { |
782 | /* HWFLOW */ | 771 | /* HWFLOW */ |
783 | if (ch->ch_c_cflag & CRTSCTS) { | 772 | if (ch->ch_c_cflag & CRTSCTS) { |
784 | if(!(ch->ch_flags & CH_RECEIVER_OFF)) { | 773 | if (!(ch->ch_flags & CH_RECEIVER_OFF)) { |
785 | bd_ops->disable_receiver(ch); | 774 | bd_ops->disable_receiver(ch); |
786 | ch->ch_flags |= (CH_RECEIVER_OFF); | 775 | ch->ch_flags |= (CH_RECEIVER_OFF); |
787 | jsm_dbg(READ, &ch->ch_bd->pci_dev, | 776 | jsm_dbg(READ, &ch->ch_bd->pci_dev, |