Skip to contentSkip to conversation

net/ibmtr: remove sleep_on*() usage

PATCH New Nishanth Aravamudan 1 participant 1 message Jan 26, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ibmtr: remove sleep_on*() usage

Hi,

Please consider applying.

Description: Directly use wait-queues instead of the deprecated sleep_on_timeout(). Since the sleep in this function is unconditional, wait_event_timeout() does not appear to be appropriate.

drivers/net/tokenring/ibmtr.c +5 -1
@@ -109,6 +109,7 @@ in the event that chatty debug messages 
 
 #include <linux/module.h>
 #include <linux/delay.h>
+#include <linux/wait.h>
 
 #ifdef PCMCIA		/* required for ibmtr_cs.c to build */
 #undef MODULE		/* yes, really */
@@ -847,6 +848,7 @@ static int __devinit trdev_init(struct n
 
 static int tok_init_card(struct net_device *dev)
 {
+	DEFINE_WAIT(wait);
 	struct tok_info *ti;
 	short PIOaddr;
 	unsigned long i;
@@ -867,7 +869,9 @@ static int tok_init_card(struct net_devi
 		writeb(SRPR_ENABLE_PAGING,ti->mmio+ACA_OFFSET+ACA_RW+SRPR_EVEN);
 #endif
 	writeb(INT_ENABLE, ti->mmio + ACA_OFFSET + ACA_SET + ISRP_EVEN);
-	i = sleep_on_timeout(&ti->wait_for_reset, 4 * HZ);
+	prepare_to_wait(&ti->wait_for_reset, &wait, TASK_UNINTERRUPTIBLE);
+	i = schedule_timeout(4*HZ);
+	finish_wait(&ti->wait_for_reset, &wait);
 	return i? 0 : -EAGAIN;
 }
 

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