]> git.hungrycats.org Git - linux/commitdiff
[PATCH] I2C: replace schedule_timeout() with msleep_interruptible() in i2c-ibm_iic.c
authorNishanth Aravamudan <nacc@us.ibm.com>
Tue, 19 Oct 2004 08:21:15 +0000 (01:21 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 19 Oct 2004 08:21:15 +0000 (01:21 -0700)
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.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/i2c/busses/i2c-ibm_iic.c

index fcb525296c2f1dfcf33138ee7f00690c5ee42aeb..85b6f9ed9da3f97e80e3f4aa3c213b2ad1e821aa 100644 (file)
@@ -416,10 +416,8 @@ static int iic_wait_for_tc(struct ibm_iic_private* dev){
                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))){