Commit dfdcfd63 authored by Domen Puncer's avatar Domen Puncer Committed by Linus Torvalds

[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: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarDomen Puncer <domen@coderock.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 962fa801
...@@ -127,6 +127,7 @@ ...@@ -127,6 +127,7 @@
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/wait.h>
#include <linux/parport.h> #include <linux/parport.h>
#undef LP_STATS #undef LP_STATS
...@@ -218,6 +219,7 @@ static int lp_reset(int minor) ...@@ -218,6 +219,7 @@ static int lp_reset(int minor)
static void lp_error (int minor) static void lp_error (int minor)
{ {
DEFINE_WAIT(wait);
int polling; int polling;
if (LP_F(minor) & LP_ABORT) if (LP_F(minor) & LP_ABORT)
...@@ -225,8 +227,9 @@ static void lp_error (int minor) ...@@ -225,8 +227,9 @@ static void lp_error (int minor)
polling = lp_table[minor].dev->port->irq == PARPORT_IRQ_NONE; polling = lp_table[minor].dev->port->irq == PARPORT_IRQ_NONE;
if (polling) lp_release_parport (&lp_table[minor]); if (polling) lp_release_parport (&lp_table[minor]);
interruptible_sleep_on_timeout (&lp_table[minor].waitq, prepare_to_wait(&lp_table[minor].waitq, &wait, TASK_INTERRUPTIBLE);
LP_TIMEOUT_POLLED); schedule_timeout(LP_TIMEOUT_POLLED);
finish_wait(&lp_table[minor].waitq, &wait);
if (polling) lp_claim_parport_or_block (&lp_table[minor]); if (polling) lp_claim_parport_or_block (&lp_table[minor]);
else parport_yield_blocking (lp_table[minor].dev); else parport_yield_blocking (lp_table[minor].dev);
} }
...@@ -412,6 +415,7 @@ static ssize_t lp_write(struct file * file, const char __user * buf, ...@@ -412,6 +415,7 @@ static ssize_t lp_write(struct file * file, const char __user * buf,
static ssize_t lp_read(struct file * file, char __user * buf, static ssize_t lp_read(struct file * file, char __user * buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
DEFINE_WAIT(wait);
unsigned int minor=iminor(file->f_dentry->d_inode); unsigned int minor=iminor(file->f_dentry->d_inode);
struct parport *port = lp_table[minor].dev->port; struct parport *port = lp_table[minor].dev->port;
ssize_t retval = 0; ssize_t retval = 0;
...@@ -460,9 +464,11 @@ static ssize_t lp_read(struct file * file, char __user * buf, ...@@ -460,9 +464,11 @@ static ssize_t lp_read(struct file * file, char __user * buf,
retval = -EIO; retval = -EIO;
goto out; goto out;
} }
} else } else {
interruptible_sleep_on_timeout (&lp_table[minor].waitq, prepare_to_wait(&lp_table[minor].waitq, &wait, TASK_INTERRUPTIBLE);
LP_TIMEOUT_POLLED); schedule_timeout(LP_TIMEOUT_POLLED);
finish_wait(&lp_table[minor].waitq, &wait);
}
if (signal_pending (current)) { if (signal_pending (current)) {
retval = -ERESTARTSYS; retval = -ERESTARTSYS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment