Commit 638861d5 authored by Kumar Gala's avatar Kumar Gala Committed by Linus Torvalds

[PATCH] cpm_uart: use schedule_timeout instead of direct call to schedule

use schedule_timeout instead of direct call to schedule
Signed-off-by: default avatarMarcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: default avatarKumar Gala <kumar.gala@freescale.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0d8ba1a9
...@@ -403,10 +403,8 @@ static int cpm_uart_startup(struct uart_port *port) ...@@ -403,10 +403,8 @@ static int cpm_uart_startup(struct uart_port *port)
inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo) inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo)
{ {
unsigned long target_jiffies = jiffies + pinfo->wait_closing; set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(pinfo->wait_closing);
while (!time_after(jiffies, target_jiffies))
schedule();
} }
/* /*
...@@ -425,9 +423,12 @@ static void cpm_uart_shutdown(struct uart_port *port) ...@@ -425,9 +423,12 @@ static void cpm_uart_shutdown(struct uart_port *port)
/* If the port is not the console, disable Rx and Tx. */ /* If the port is not the console, disable Rx and Tx. */
if (!(pinfo->flags & FLAG_CONSOLE)) { if (!(pinfo->flags & FLAG_CONSOLE)) {
/* Wait for all the BDs marked sent */ /* Wait for all the BDs marked sent */
while(!cpm_uart_tx_empty(port)) while(!cpm_uart_tx_empty(port)) {
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(2); schedule_timeout(2);
if(pinfo->wait_closing) }
if (pinfo->wait_closing)
cpm_uart_wait_until_send(pinfo); cpm_uart_wait_until_send(pinfo);
/* Stop uarts */ /* Stop uarts */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment