Misc fixes to sync with mainline
[pandora-kernel.git] / arch / arm / mach-omap2 / serial.c
index 33a30e1..bd6f8c9 100644 (file)
 
 #include <linux/io.h>
 
-#include <asm/arch/common.h>
-#include <asm/arch/board.h>
+#include <mach/common.h>
+#include <mach/board.h>
 
 static struct clk *uart_ick[OMAP_MAX_NR_PORTS];
 static struct clk *uart_fck[OMAP_MAX_NR_PORTS];
 
 static struct plat_serial8250_port serial_platform_data[] = {
        {
-               .membase        = (char *)IO_ADDRESS(OMAP_UART1_BASE),
+               .membase        = (void __iomem *)IO_ADDRESS(OMAP_UART1_BASE),
                .mapbase        = (unsigned long)OMAP_UART1_BASE,
                .irq            = 72,
                .flags          = UPF_BOOT_AUTOCONF,
@@ -36,7 +36,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
                .regshift       = 2,
                .uartclk        = OMAP24XX_BASE_BAUD * 16,
        }, {
-               .membase        = (char *)IO_ADDRESS(OMAP_UART2_BASE),
+               .membase        = (void __iomem *)IO_ADDRESS(OMAP_UART2_BASE),
                .mapbase        = (unsigned long)OMAP_UART2_BASE,
                .irq            = 73,
                .flags          = UPF_BOOT_AUTOCONF,
@@ -44,7 +44,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
                .regshift       = 2,
                .uartclk        = OMAP24XX_BASE_BAUD * 16,
        }, {
-               .membase        = (char *)IO_ADDRESS(OMAP_UART3_BASE),
+               .membase        = (void __iomem *)IO_ADDRESS(OMAP_UART3_BASE),
                .mapbase        = (unsigned long)OMAP_UART3_BASE,
                .irq            = 74,
                .flags          = UPF_BOOT_AUTOCONF,
@@ -67,7 +67,7 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
                                    int value)
 {
        offset <<= p->regshift;
-       __raw_writeb(value, (unsigned long)(p->membase + offset));
+       __raw_writeb(value, p->membase + offset);
 }
 
 /*
@@ -87,12 +87,15 @@ void omap_serial_enable_clocks(int enable)
 {
        int i;
        for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
-               if (uart_ick[i])
-                       enable ? clk_enable(uart_ick[i]) :
+               if (uart_ick[i] && uart_fck[i]) {
+                       if (enable) {
+                               clk_enable(uart_ick[i]);
+                               clk_enable(uart_fck[i]);
+                       } else {
                                clk_disable(uart_ick[i]);
-               if (uart_fck[i])
-                       enable ? clk_enable(uart_fck[i]) :
                                clk_disable(uart_fck[i]);
+                       }
+               }
        }
 }
 
@@ -117,7 +120,7 @@ void __init omap_serial_init(void)
                struct plat_serial8250_port *p = serial_platform_data + i;
 
                if (!(info->enabled_uarts & (1 << i))) {
-                       p->membase = 0;
+                       p->membase = NULL;
                        p->mapbase = 0;
                        continue;
                }