diff options
author | Takashi Yoshii <takashi.yoshii.zj@renesas.com> | 2012-11-15 20:53:11 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-15 21:02:37 -0500 |
commit | 63f7ad115ef35b711f3ae2b46a07acbf1ca3bdfd (patch) | |
tree | 1d546005b103612d5dd3ba5fec3f50cfca4a3fe8 /drivers/tty | |
parent | 9d482cc353bd0391730730b26e4c2938dc90e477 (diff) |
serial: sh-sci: mask SCTFDR/RFDR according to fifosize
Current mask 0xff to SCTFDR/RFDR damages SCIFB, because the
registers on SCIFB have 9-bit data (0 to 256).
This patch changes the mask according to port->fifosize.
Though I'm not sure if the mask is really needed (I don't know if
there are variants which have non-zero upper bits), it is safer.
Signed-off-by: Takashi Yoshii <takashi.yoshii.zj@renesas.com>
Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index a54c47d0fd63..c2d359cba55d 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -485,7 +485,7 @@ static int sci_txfill(struct uart_port *port) | |||
485 | 485 | ||
486 | reg = sci_getreg(port, SCTFDR); | 486 | reg = sci_getreg(port, SCTFDR); |
487 | if (reg->size) | 487 | if (reg->size) |
488 | return serial_port_in(port, SCTFDR) & 0xff; | 488 | return serial_port_in(port, SCTFDR) & ((port->fifosize << 1) - 1); |
489 | 489 | ||
490 | reg = sci_getreg(port, SCFDR); | 490 | reg = sci_getreg(port, SCFDR); |
491 | if (reg->size) | 491 | if (reg->size) |
@@ -505,7 +505,7 @@ static int sci_rxfill(struct uart_port *port) | |||
505 | 505 | ||
506 | reg = sci_getreg(port, SCRFDR); | 506 | reg = sci_getreg(port, SCRFDR); |
507 | if (reg->size) | 507 | if (reg->size) |
508 | return serial_port_in(port, SCRFDR) & 0xff; | 508 | return serial_port_in(port, SCRFDR) & ((port->fifosize << 1) - 1); |
509 | 509 | ||
510 | reg = sci_getreg(port, SCFDR); | 510 | reg = sci_getreg(port, SCFDR); |
511 | if (reg->size) | 511 | if (reg->size) |