| From 931612e926da91a2fe197b43ed0294bd04ce1fd1 Mon Sep 17 00:00:00 2001 |
| From: Paul Mundt <lethal@linux-sh.org> |
| Date: Wed, 8 Jun 2011 17:06:25 +0900 |
| Subject: serial: sh-sci: Tidy up ioread/write wrappers, kill off unused SCI |
| helper. |
| |
| Signed-off-by: Paul Mundt <lethal@linux-sh.org> |
| (cherry picked from commit a01cdc10689f5d252530d14474528ea785ecfde4) |
| |
| Signed-off-by: Simon Horman <horms@verge.net.au> |
| --- |
| drivers/tty/serial/sh-sci.h | 35 +++++++++-------------------------- |
| 1 file changed, 9 insertions(+), 26 deletions(-) |
| |
| diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h |
| index e1ceebb..2d667ab 100644 |
| --- a/drivers/tty/serial/sh-sci.h |
| +++ b/drivers/tty/serial/sh-sci.h |
| @@ -183,32 +183,25 @@ |
| #define SCI_MAJOR 204 |
| #define SCI_MINOR_START 8 |
| |
| -#define SCI_IN(size, offset) \ |
| - if ((size) == 8) { \ |
| - return ioread8(port->membase + (offset)); \ |
| - } else { \ |
| - return ioread16(port->membase + (offset)); \ |
| - } |
| -#define SCI_OUT(size, offset, value) \ |
| - if ((size) == 8) { \ |
| - iowrite8(value, port->membase + (offset)); \ |
| - } else if ((size) == 16) { \ |
| - iowrite16(value, port->membase + (offset)); \ |
| - } |
| +#define SCI_IN(size, offset) \ |
| + ioread##size(port->membase + (offset)) |
| + |
| +#define SCI_OUT(size, offset, value) \ |
| + iowrite##size(value, port->membase + (offset)) |
| |
| #define CPU_SCIx_FNS(name, sci_offset, sci_size, scif_offset, scif_size)\ |
| static inline unsigned int sci_##name##_in(struct uart_port *port) \ |
| { \ |
| if (port->type == PORT_SCIF || port->type == PORT_SCIFB) { \ |
| - SCI_IN(scif_size, scif_offset) \ |
| + return SCI_IN(scif_size, scif_offset); \ |
| } else { /* PORT_SCI or PORT_SCIFA */ \ |
| - SCI_IN(sci_size, sci_offset); \ |
| + return SCI_IN(sci_size, sci_offset); \ |
| } \ |
| } \ |
| static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \ |
| { \ |
| if (port->type == PORT_SCIF || port->type == PORT_SCIFB) { \ |
| - SCI_OUT(scif_size, scif_offset, value) \ |
| + SCI_OUT(scif_size, scif_offset, value); \ |
| } else { /* PORT_SCI or PORT_SCIFA */ \ |
| SCI_OUT(sci_size, sci_offset, value); \ |
| } \ |
| @@ -217,23 +210,13 @@ |
| #define CPU_SCIF_FNS(name, scif_offset, scif_size) \ |
| static inline unsigned int sci_##name##_in(struct uart_port *port) \ |
| { \ |
| - SCI_IN(scif_size, scif_offset); \ |
| + return SCI_IN(scif_size, scif_offset); \ |
| } \ |
| static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \ |
| { \ |
| SCI_OUT(scif_size, scif_offset, value); \ |
| } |
| |
| -#define CPU_SCI_FNS(name, sci_offset, sci_size) \ |
| - static inline unsigned int sci_##name##_in(struct uart_port* port) \ |
| - { \ |
| - SCI_IN(sci_size, sci_offset); \ |
| - } \ |
| - static inline void sci_##name##_out(struct uart_port* port, unsigned int value) \ |
| - { \ |
| - SCI_OUT(sci_size, sci_offset, value); \ |
| - } |
| - |
| #if defined(CONFIG_CPU_SH3) || \ |
| defined(CONFIG_ARCH_SH73A0) || \ |
| defined(CONFIG_ARCH_SH7367) || \ |
| -- |
| 1.7.10 |
| |