From: Tony Lindgren Date: Thu, 8 Jan 2009 09:39:00 +0000 (+0200) Subject: Fix compile for serial init if CONFIG_PM is not selected X-Git-Tag: v2.6.28-omap1~12 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e8b22165f8af8cf9827d6c3e1279c17a457efb08;p=linux-2.6-omap-h63xx.git Fix compile for serial init if CONFIG_PM is not selected This patch should be merged into the "MAP3: PM: UART: disable clocks when idle" patch for omap-pm-upstream. Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 7f9a50da55f..fd5b9f83e0b 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -125,6 +125,16 @@ static inline void __init omap_uart_reset(struct omap_uart_state *uart) serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0)); } +static inline void omap_uart_enable_clocks(struct omap_uart_state *uart) +{ + if (uart->clocked) + return; + + clk_enable(uart->ick); + clk_enable(uart->fck); + uart->clocked = 1; +} + #ifdef CONFIG_PM #ifdef CONFIG_ARCH_OMAP3 @@ -204,14 +214,9 @@ static void omap_uart_smart_idle_enable(struct omap_uart_state *uart, serial_write_reg(p, UART_OMAP_SYSC, sysc); } -static inline void omap_uart_enable_clocks(struct omap_uart_state *uart) +static inline void omap_uart_restore(struct omap_uart_state *uart) { - if (uart->clocked) - return; - - clk_enable(uart->ick); - clk_enable(uart->fck); - uart->clocked = 1; + omap_uart_enable_clocks(uart); omap_uart_restore_context(uart); } @@ -228,7 +233,7 @@ static inline void omap_uart_disable_clocks(struct omap_uart_state *uart) static void omap_uart_block_sleep(struct omap_uart_state *uart) { - omap_uart_enable_clocks(uart); + omap_uart_restore(uart); omap_uart_smart_idle_enable(uart, 0); uart->can_sleep = 0; @@ -273,7 +278,7 @@ void omap_uart_resume_idle(int num) list_for_each_entry(uart, &uart_list, node) { if (num == uart->num) { - omap_uart_enable_clocks(uart); + omap_uart_restore(uart); /* Check for IO pad wakeup */ if (cpu_is_omap34xx() && uart->padconf) {