Skip to contentSkip to conversation

i2c/i2c-ibm_iic: replace schedule_timeout() with

PATCH New Nishanth Aravamudan 1 participant 1 message Oct 14, 2004

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

PATCH 1/1 i2c/i2c-ibm_iic: replace schedule_timeout() with

Any comments would be appreciated.

Description: Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected. Remove the unnecessary set_current_state() following the if, as schedule_timeout() [and thus, mlseep_interruptible()] is guaranteed to return in TASK_RUNNING.

drivers/i2c/busses/i2c-ibm_iic.c +1 -3
@@ -416,10 +416,8 @@ static int iic_wait_for_tc(struct ibm_ii
     		init_waitqueue_entry(&wait, current);
 		
 		add_wait_queue(&dev->wq, &wait);
-		set_current_state(TASK_INTERRUPTIBLE);
 		if (in_8(&iic->sts) & STS_PT)
-			schedule_timeout(dev->adap.timeout * HZ);
-		set_current_state(TASK_RUNNING);
+			msleep_interruptible(dev->adap.timeout * 1000);
 		remove_wait_queue(&dev->wq, &wait);
 		
 		if (unlikely(signal_pending(current))){

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