aboutsummaryrefslogtreecommitdiff
path: root/drivers/serial/cpm_uart
diff options
context:
space:
mode:
authorKumar Gala <galak@freescale.com>2005-09-03 15:55:37 -0700
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 00:05:56 -0700
commit638861d54eec6b04a88d5d8df8b790d87de80b8d (patch)
tree1ebb80d55a39369620dbb041244cdd3ce794fb8f /drivers/serial/cpm_uart
parent0d8ba1a9793302fdcee3d6d4133c455023ca8ce9 (diff)
[PATCH] cpm_uart: use schedule_timeout instead of direct call to schedule
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>
Diffstat (limited to 'drivers/serial/cpm_uart')
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_core.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 282b32351d8..25825f2aba2 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -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);
}
/*
@@ -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 */