Skip to content

Commit

Permalink
[SPARC]: sbus/vfc_i2c: remove sleep_on() usage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nishanth Aravamudan authored and David S. Miller committed Jul 25, 2005
1 parent cb39d26 commit 2d1aea8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/sbus/char/vfc_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2d1aea8

Please sign in to comment.