aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sh-sci.c
diff options
context:
space:
mode:
authorTakashi Yoshii <takashi.yoshii.zj@renesas.com>2012-11-16 10:53:11 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-15 18:02:37 -0800
commit63f7ad115ef35b711f3ae2b46a07acbf1ca3bdfd (patch)
tree1d546005b103612d5dd3ba5fec3f50cfca4a3fe8 /drivers/tty/serial/sh-sci.c
parentserial: sh-sci: support lower baud rate (diff)
downloadlinux-dev-63f7ad115ef35b711f3ae2b46a07acbf1ca3bdfd.tar.xz
linux-dev-63f7ad115ef35b711f3ae2b46a07acbf1ca3bdfd.zip
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/serial/sh-sci.c')
-rw-r--r--drivers/tty/serial/sh-sci.c4
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)
reg = sci_getreg(port, SCTFDR);
if (reg->size)
- return serial_port_in(port, SCTFDR) & 0xff;
+ return serial_port_in(port, SCTFDR) & ((port->fifosize << 1) - 1);
reg = sci_getreg(port, SCFDR);
if (reg->size)
@@ -505,7 +505,7 @@ static int sci_rxfill(struct uart_port *port)
reg = sci_getreg(port, SCRFDR);
if (reg->size)
- return serial_port_in(port, SCRFDR) & 0xff;
+ return serial_port_in(port, SCRFDR) & ((port->fifosize << 1) - 1);
reg = sci_getreg(port, SCFDR);
if (reg->size)