aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parport/ieee1284.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2005-09-10 00:27:31 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 10:06:38 -0700
commit7b4ccf8db4c1dc343ad5d6ed19240bbc3b5f945f (patch)
tree5e73fbba733a6e77f157c4022ee26b8c56b7410e /drivers/parport/ieee1284.c
parent[PATCH] drivers/char: fix-up schedule_timeout() usage (diff)
downloadlinux-dev-7b4ccf8db4c1dc343ad5d6ed19240bbc3b5f945f.tar.xz
linux-dev-7b4ccf8db4c1dc343ad5d6ed19240bbc3b5f945f.zip
[PATCH] parport: fix-up schedule_timeout() usage
Use schedule_timeout_interruptible() instead of set_current_state()/schedule_timeout() to reduce kernel size. Also use human-time to jiffies units conversion functions rather than direct HZ division to avoid rounding issues. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/parport/ieee1284.c')
-rw-r--r--drivers/parport/ieee1284.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/parport/ieee1284.c b/drivers/parport/ieee1284.c
index 694bae162fed..5b887ba5aaf9 100644
--- a/drivers/parport/ieee1284.c
+++ b/drivers/parport/ieee1284.c
@@ -196,7 +196,7 @@ int parport_wait_peripheral(struct parport *port,
return 1;
/* 40ms of slow polling. */
- deadline = jiffies + (HZ + 24) / 25;
+ deadline = jiffies + msecs_to_jiffies(40);
while (time_before (jiffies, deadline)) {
int ret;
@@ -205,7 +205,7 @@ int parport_wait_peripheral(struct parport *port,
/* Wait for 10ms (or until an interrupt occurs if
* the handler is set) */
- if ((ret = parport_wait_event (port, (HZ + 99) / 100)) < 0)
+ if ((ret = parport_wait_event (port, msecs_to_jiffies(10))) < 0)
return ret;
status = parport_read_status (port);
@@ -216,8 +216,7 @@ int parport_wait_peripheral(struct parport *port,
/* 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);
+ schedule_timeout_interruptible(msecs_to_jiffies(10));
}
}