diff options
author | Kumar Gala <galak@freescale.com> | 2005-09-03 18:55:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:05:56 -0400 |
commit | 638861d54eec6b04a88d5d8df8b790d87de80b8d (patch) | |
tree | 1ebb80d55a39369620dbb041244cdd3ce794fb8f /drivers/serial/cpm_uart | |
parent | 0d8ba1a9793302fdcee3d6d4133c455023ca8ce9 (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.c | 13 |
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 282b32351d8e..25825f2aba22 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) | |||
403 | 403 | ||
404 | inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo) | 404 | inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo) |
405 | { | 405 | { |
406 | unsigned long target_jiffies = jiffies + pinfo->wait_closing; | 406 | set_current_state(TASK_UNINTERRUPTIBLE); |
407 | 407 | schedule_timeout(pinfo->wait_closing); | |
408 | while (!time_after(jiffies, target_jiffies)) | ||
409 | schedule(); | ||
410 | } | 408 | } |
411 | 409 | ||
412 | /* | 410 | /* |
@@ -425,9 +423,12 @@ static void cpm_uart_shutdown(struct uart_port *port) | |||
425 | /* If the port is not the console, disable Rx and Tx. */ | 423 | /* If the port is not the console, disable Rx and Tx. */ |
426 | if (!(pinfo->flags & FLAG_CONSOLE)) { | 424 | if (!(pinfo->flags & FLAG_CONSOLE)) { |
427 | /* Wait for all the BDs marked sent */ | 425 | /* Wait for all the BDs marked sent */ |
428 | while(!cpm_uart_tx_empty(port)) | 426 | while(!cpm_uart_tx_empty(port)) { |
427 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
429 | schedule_timeout(2); | 428 | schedule_timeout(2); |
430 | if(pinfo->wait_closing) | 429 | } |
430 | |||
431 | if (pinfo->wait_closing) | ||
431 | cpm_uart_wait_until_send(pinfo); | 432 | cpm_uart_wait_until_send(pinfo); |
432 | 433 | ||
433 | /* Stop uarts */ | 434 | /* Stop uarts */ |