Skip to content

Commit

Permalink
[PATCH] cpm_uart: use schedule_timeout instead of direct call to sche…
Browse files Browse the repository at this point in the history
…dule

use schedule_timeout instead of direct call to schedule

Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Kumar Gala authored and Linus Torvalds committed Sep 5, 2005
1 parent 0d8ba1a commit 638861d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/serial/cpm_uart/cpm_uart_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
unsigned long target_jiffies = jiffies + pinfo->wait_closing;

while (!time_after(jiffies, target_jiffies))
schedule();
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(pinfo->wait_closing);
}

/*
Expand All @@ -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 (!(pinfo->flags & FLAG_CONSOLE)) {
/* 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);
if(pinfo->wait_closing)
}

if (pinfo->wait_closing)
cpm_uart_wait_until_send(pinfo);

/* Stop uarts */
Expand Down

0 comments on commit 638861d

Please sign in to comment.