parport/ieee1284: use human-time in sleeping logic
Subsystems (2)
PATCH 1/1 parport/ieee1284: use human-time in sleeping logic
Be a little more precise with the conversions between milliseconds and jiffies. Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected.
Signed-off-by Nishanth Aravamudan <[email protected]>
drivers/parport/ieee1284.c +3 -5
@@ -196,7 +196,7 @@ int parport_wait_peripheral(struct parporeturn 1 ;/* 40ms of slow polling. */ - deadline = jiffies + (HZ +24 ) /25 ; + deadline = jiffies +msecs_to_jiffies (40 );while (time_before (jiffies, deadline)) {int ret;
@@ -212,13 +212,11 @@ int parport_wait_peripheral(struct parpoif ((status & mask) == result)return 0 ; -if (!ret) { +if (!ret)/* parport_wait_event didn't time out, but the * peripheral wasn't actually ready either. * Wait for another 10ms. */ -__set_current_state (TASK_INTERRUPTIBLE ); -schedule_timeout ((HZ +99 ) /100 ); - } +msleep_interruptible (10 ); }return 1 ;
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors