Skip to contentSkip to conversation

ppc/serial_sicc: use poll_event*() interface

RFC PATCH In review Nishanth Aravamudan 1 participant 1 message Mar 3, 2005 Kernel janitors

lore
Share & tools
lore
#0 lore raw

RFC PATCH 4/5 ppc/serial_sicc: use poll_event*() interface

Hi,

Description: Use new poll_event*() interface to encapsulate sleep-loops.

arch/ppc/4xx_io/serial_sicc.c +8 -10
@@ -1500,16 +1500,14 @@ static void siccuart_wait_until_sent(str
 	pr_debug
 	    ("siccuart_wait_until_sent(%d), jiff=%lu, expire=%lu  char_time=%lu...\n",
 	     tty->index, jiffies, expire, char_time);
-	while ((readb(info->port->uart_base + BL_SICC_LSR) & _LSR_TX_ALL) !=
-	       _LSR_TX_ALL) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(char_time);
-		if (signal_pending(current))
-			break;
-		if (timeout && time_after(jiffies, expire))
-			break;
-	}
-	set_current_state(TASK_RUNNING);
+	if (timeout)
+		poll_event_interruptible_timeout(((readb(info->port->uart_base +
+						BL_SICC_LSR) & _LSR_TX_ALL) == _LSR_TX_ALL),
+						jiffies_to_msecs(char_time), timeout);
+	else
+		poll_event_interruptible(((readb(info->port->uart_base +
+					BL_SICC_LSR) & _LSR_TX_ALL) == _LSR_TX_ALL),
+					jiffies_to_msecs(char_time));
 }
 
 static void siccuart_hangup(struct tty_struct *tty)

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors