diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-27 10:33:21 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-27 10:33:21 +0300 |
commit | e947861d0ccbc765af4512a395251e6af6857600 (patch) | |
tree | e2b8d646f40016e887162bcaf53859edaae15bc9 /drivers/tty/rocket.c | |
parent | 6f1c0268a4871a80c0ec78142eeb1fe0556e898a (diff) | |
parent | 6a8b55ed4056ea5559ebe4f6a4b247f627870d4c (diff) | |
download | linux-e947861d0ccbc765af4512a395251e6af6857600.tar.xz |
Merge 5.7-rc3 into tty-next
We need the tty/serial fixes in here too.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/rocket.c')
-rw-r--r-- | drivers/tty/rocket.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c index 077ef849f8cb..2540b2e4c8e8 100644 --- a/drivers/tty/rocket.c +++ b/drivers/tty/rocket.c @@ -632,18 +632,21 @@ init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev) tty_port_init(&info->port); info->port.ops = &rocket_port_ops; info->flags &= ~ROCKET_MODE_MASK; - switch (pc104[board][line]) { - case 422: - info->flags |= ROCKET_MODE_RS422; - break; - case 485: - info->flags |= ROCKET_MODE_RS485; - break; - case 232: - default: + if (board < ARRAY_SIZE(pc104) && line < ARRAY_SIZE(pc104_1)) + switch (pc104[board][line]) { + case 422: + info->flags |= ROCKET_MODE_RS422; + break; + case 485: + info->flags |= ROCKET_MODE_RS485; + break; + case 232: + default: + info->flags |= ROCKET_MODE_RS232; + break; + } + else info->flags |= ROCKET_MODE_RS232; - break; - } info->intmask = RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR; if (sInitChan(ctlp, &info->channel, aiop, chan) == 0) { |