public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] tty: serial: Use hub6_serial_X when CONFIG_SERIAL_8250_HUB6 is defined
@ 2011-03-11 12:58 Nobuhiro Iwamatsu
  2011-03-11 12:58 ` [PATCH 2/3] tty: serial: Fix build on architecture that does not have ioport Nobuhiro Iwamatsu
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Nobuhiro Iwamatsu @ 2011-03-11 12:58 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, arnd, Nobuhiro Iwamatsu

hub6_serial_X comes to be always usable.
This revises it to be usable when CONFIG_SERIAL_8250_HUB6 is defined.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
 drivers/tty/serial/8250.c        |   13 ++++++++++++-
 drivers/tty/serial/serial_core.c |    4 ++++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 3975df6..762a253 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -387,6 +387,7 @@ static inline int map_8250_out_reg(struct uart_port *p, int offset)
 
 #endif
 
+#if CONFIG_SERIAL_8250_HUB6
 static unsigned int hub6_serial_in(struct uart_port *p, int offset)
 {
 	offset = map_8250_in_reg(p, offset) << p->regshift;
@@ -400,6 +401,7 @@ static void hub6_serial_out(struct uart_port *p, int offset, int value)
 	outb(p->hub6 - 1 + offset, p->iobase);
 	outb(value, p->iobase + 1);
 }
+#endif
 
 static unsigned int mem_serial_in(struct uart_port *p, int offset)
 {
@@ -508,10 +510,12 @@ static void set_io_from_upio(struct uart_port *p)
 	struct uart_8250_port *up =
 		container_of(p, struct uart_8250_port, port);
 	switch (p->iotype) {
+#if CONFIG_SERIAL_8250_HUB6
 	case UPIO_HUB6:
 		p->serial_in = hub6_serial_in;
 		p->serial_out = hub6_serial_out;
 		break;
+#endif
 
 	case UPIO_MEM:
 		p->serial_in = mem_serial_in;
@@ -2538,8 +2542,9 @@ static int serial8250_request_std_resource(struct uart_8250_port *up)
 			}
 		}
 		break;
-
+#if CONFIG_SERIAL_8250_HUB6
 	case UPIO_HUB6:
+#endif
 	case UPIO_PORT:
 		if (!request_region(up->port.iobase, size, "serial"))
 			ret = -EBUSY;
@@ -2570,7 +2575,9 @@ static void serial8250_release_std_resource(struct uart_8250_port *up)
 		release_mem_region(up->port.mapbase, size);
 		break;
 
+#if CONFIG_SERIAL_8250_HUB6
 	case UPIO_HUB6:
+#endif
 	case UPIO_PORT:
 		release_region(up->port.iobase, size);
 		break;
@@ -2584,7 +2591,9 @@ static int serial8250_request_rsa_resource(struct uart_8250_port *up)
 	int ret = -EINVAL;
 
 	switch (up->port.iotype) {
+#if CONFIG_SERIAL_8250_HUB6
 	case UPIO_HUB6:
+#endif
 	case UPIO_PORT:
 		start += up->port.iobase;
 		if (request_region(start, size, "serial-rsa"))
@@ -2603,7 +2612,9 @@ static void serial8250_release_rsa_resource(struct uart_8250_port *up)
 	unsigned int size = 8 << up->port.regshift;
 
 	switch (up->port.iotype) {
+#if CONFIG_SERIAL_8250_HUB6
 	case UPIO_HUB6:
+#endif
 	case UPIO_PORT:
 		release_region(up->port.iobase + offset, size);
 		break;
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 460a72d..c533524 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2129,10 +2129,12 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port)
 	case UPIO_PORT:
 		snprintf(address, sizeof(address), "I/O 0x%lx", port->iobase);
 		break;
+#if CONFIG_SERIAL_8250_HUB6
 	case UPIO_HUB6:
 		snprintf(address, sizeof(address),
 			 "I/O 0x%lx offset 0x%x", port->iobase, port->hub6);
 		break;
+#endif
 	case UPIO_MEM:
 	case UPIO_MEM32:
 	case UPIO_AU:
@@ -2551,9 +2553,11 @@ int uart_match_port(struct uart_port *port1, struct uart_port *port2)
 	switch (port1->iotype) {
 	case UPIO_PORT:
 		return (port1->iobase == port2->iobase);
+#if CONFIG_SERIAL_8250_HUB6
 	case UPIO_HUB6:
 		return (port1->iobase == port2->iobase) &&
 		       (port1->hub6   == port2->hub6);
+#endif
 	case UPIO_MEM:
 	case UPIO_MEM32:
 	case UPIO_AU:
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-03-11 14:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-11 12:58 [PATCH 1/3] tty: serial: Use hub6_serial_X when CONFIG_SERIAL_8250_HUB6 is defined Nobuhiro Iwamatsu
2011-03-11 12:58 ` [PATCH 2/3] tty: serial: Fix build on architecture that does not have ioport Nobuhiro Iwamatsu
2011-03-11 13:54   ` Alan Cox
2011-03-11 14:16     ` Arnd Bergmann
2011-03-11 12:58 ` [PATCH 3/3] tty: serial: Check UPF_FOURPORT, when CONFIG_SERIAL_8250_FOURPORT is defined Nobuhiro Iwamatsu
2011-03-11 13:55   ` Alan Cox
2011-03-11 13:50 ` [PATCH 1/3] tty: serial: Use hub6_serial_X when CONFIG_SERIAL_8250_HUB6 " Alan Cox
2011-03-11 13:56   ` Arnd Bergmann
2011-03-11 14:30     ` Alan Cox
2011-03-11 14:54       ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox