sh-sci: avoid writing to nonexistent registers
authorMagnus Damm <magnus.damm@gmail.com>
Wed, 23 Apr 2008 12:37:39 +0000 (21:37 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Thu, 8 May 2008 10:51:59 +0000 (19:51 +0900)
Only write to hardware in SCI_OUT() if the register size is valid.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/serial/sh-sci.h

index b0dac379dee5362f040e60ed08865ce7135731b2..eb84833233fd98e690a1f08831b6cacf42fe2289 100644 (file)
   unsigned int addr = port->mapbase + (offset);                        \
   if ((size) == 8) {                                           \
     ctrl_outb(value, addr);                                    \
-  } else {                                                     \
+  } else if ((size) == 16) {                                   \
     ctrl_outw(value, addr);                                    \
   }