MIPS: Loongson: Cleanups of serial port support

This patchs uses a loongson_uart_base variable instead of the
uart_base[] array and adds a new kernel option to avoid to compile
uart_base.c all the time, which will save a little bit of memory for us.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
http://patchwork.linux-mips.org/patch/727/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
diff --git a/arch/mips/loongson/common/serial.c b/arch/mips/loongson/common/serial.c
index ea29db0..23b66a5 100644
--- a/arch/mips/loongson/common/serial.c
+++ b/arch/mips/loongson/common/serial.c
@@ -57,12 +57,16 @@
 
 static int __init serial_init(void)
 {
-	if (uart8250_data[mips_machtype][0].iotype == UPIO_MEM)
+	unsigned char iotype;
+
+	iotype = uart8250_data[mips_machtype][0].iotype;
+
+	if (UPIO_MEM == iotype)
 		uart8250_data[mips_machtype][0].membase =
 			(void __iomem *)_loongson_uart_base;
-	else if (uart8250_data[mips_machtype][0].iotype == UPIO_PORT)
+	else if (UPIO_PORT == iotype)
 		uart8250_data[mips_machtype][0].iobase =
-		    uart8250_base[mips_machtype] - LOONGSON_PCIIO_BASE;
+		    loongson_uart_base - LOONGSON_PCIIO_BASE;
 
 	uart8250_device.dev.platform_data = uart8250_data[mips_machtype];