From: Yoshinori Sato Date: Fri, 28 Dec 2018 15:04:46 +0000 (+0900) Subject: fix 8bit register X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4a04cc976e2e82ed81bd196c88010c43abcbb9da;p=uclinux-h8%2Flinux.git fix 8bit register --- diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 39b82449d20f..ce1b37e87547 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -2959,12 +2959,13 @@ static int sci_init_single(struct platform_device *dev, port->flags = UPF_FIXED_PORT | UPF_BOOT_AUTOCONF | p->flags; port->fifosize = sci_port->params->fifosize; - if (port->type == PORT_SCI) { - if (sci_port->reg_size >= 0x20) - port->regshift = 2; - else - port->regshift = 1; - } + if (port->type == PORT_SCI) + /* + < 0x10: 8bit alignment + >= 0x10 && < 0x20: 16bit alignment + >= 0x20: 32bit alignment + */ + port->regshift = (sci_port->reg_size >> 4); /* * The UART port needs an IRQ value, so we peg this to the RX IRQ