]> err.no Git - linux-2.6/commitdiff
[SPARC]: sbus/vfc_i2c: remove sleep_on() usage
authorNishanth Aravamudan <nacc@us.ibm.com>
Mon, 25 Jul 2005 02:34:47 +0000 (19:34 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Jul 2005 02:34:47 +0000 (19:34 -0700)
Use wait-queue directly instead of the deprecated sleep_on()
function. This required adding a local wait-queue. Also use new (added in
separate patch to K-J) usecs to jiffies function to convert value.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/sbus/char/vfc_i2c.c

index 95e3cebf792cf8775a1437b884c4bfdf5808e063..1faf1e75f71fa34b80c3d3f2e601b9a86d54841e 100644 (file)
@@ -88,14 +88,16 @@ void vfc_i2c_delay_wakeup(struct vfc_dev *dev)
 
 void vfc_i2c_delay_no_busy(struct vfc_dev *dev, unsigned long usecs) 
 {
+       DEFINE_WAIT(wait);
        init_timer(&dev->poll_timer);
-       dev->poll_timer.expires = jiffies + 
-               ((unsigned long)usecs*(HZ))/1000000;
+       dev->poll_timer.expires = jiffies + usecs_to_jiffies(usecs);
        dev->poll_timer.data=(unsigned long)dev;
        dev->poll_timer.function=(void *)(unsigned long)vfc_i2c_delay_wakeup;
        add_timer(&dev->poll_timer);
-       sleep_on(&dev->poll_wait);
+       prepare_to_wait(&dev->poll_wait, &wait, TASK_UNINTERRUPTIBLE);
+       schedule();
        del_timer(&dev->poll_timer);
+       finish_wait(&dev->poll_wait, &wait);
 }
 
 void inline vfc_i2c_delay(struct vfc_dev *dev)