summaryrefslogtreecommitdiff
path: root/drivers/char/lp.c
diff options
context:
space:
mode:
authorDomen Puncer <domen@coderock.org>2005-03-13 00:58:13 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-13 00:58:13 -0800
commitdfdcfd635488801ac714ef0fb773995351c134d5 (patch)
treed498a1fe3deb0f9ac6e820c68ebbdf9a6d0146b2 /drivers/char/lp.c
parent962fa8018f8d248660aa82f3f5474e397820b5bc (diff)
[PATCH] char/lp: remove interruptible_sleep_on_timeout() usage
Replace deprecated interruptible_sleep_on_timeout() function calls with direct wait-queue usage. There may be an existing problem with this driver, as I am not finding any wake_up_interruptible() callers for the waitq. Patch is compile-tested. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/lp.c')
-rw-r--r--drivers/char/lp.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index 94e7d851d770..4dee945031d4 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -127,6 +127,7 @@
#include <linux/poll.h>
#include <linux/console.h>
#include <linux/device.h>
+#include <linux/wait.h>
#include <linux/parport.h>
#undef LP_STATS
@@ -218,6 +219,7 @@ static int lp_reset(int minor)
static void lp_error (int minor)
{
+ DEFINE_WAIT(wait);
int polling;
if (LP_F(minor) & LP_ABORT)
@@ -225,8 +227,9 @@ static void lp_error (int minor)
polling = lp_table[minor].dev->port->irq == PARPORT_IRQ_NONE;
if (polling) lp_release_parport (&lp_table[minor]);
- interruptible_sleep_on_timeout (&lp_table[minor].waitq,
- LP_TIMEOUT_POLLED);
+ prepare_to_wait(&lp_table[minor].waitq, &wait, TASK_INTERRUPTIBLE);
+ schedule_timeout(LP_TIMEOUT_POLLED);
+ finish_wait(&lp_table[minor].waitq, &wait);
if (polling) lp_claim_parport_or_block (&lp_table[minor]);
else parport_yield_blocking (lp_table[minor].dev);
}
@@ -412,6 +415,7 @@ out_unlock:
static ssize_t lp_read(struct file * file, char __user * buf,
size_t count, loff_t *ppos)
{
+ DEFINE_WAIT(wait);
unsigned int minor=iminor(file->f_dentry->d_inode);
struct parport *port = lp_table[minor].dev->port;
ssize_t retval = 0;
@@ -460,9 +464,11 @@ static ssize_t lp_read(struct file * file, char __user * buf,
retval = -EIO;
goto out;
}
- } else
- interruptible_sleep_on_timeout (&lp_table[minor].waitq,
- LP_TIMEOUT_POLLED);
+ } else {
+ prepare_to_wait(&lp_table[minor].waitq, &wait, TASK_INTERRUPTIBLE);
+ schedule_timeout(LP_TIMEOUT_POLLED);
+ finish_wait(&lp_table[minor].waitq, &wait);
+ }
if (signal_pending (current)) {
retval = -ERESTARTSYS;