Commit 977f4000 authored by Evgeniy Polyakov's avatar Evgeniy Polyakov Committed by Greg Kroah-Hartman

[PATCH] w1: replace obsoleted *sleep_on*

Remove obsoleded *sleep_on*.

Since they are used only to wait for a given flags and awakening
only happens on signals, we can just replace them with
msleep_interruptible.
Signed-off-by: default avatarEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7d821d99
...@@ -58,7 +58,6 @@ LIST_HEAD(w1_masters); ...@@ -58,7 +58,6 @@ LIST_HEAD(w1_masters);
static pid_t control_thread; static pid_t control_thread;
static int control_needs_exit; static int control_needs_exit;
static DECLARE_COMPLETION(w1_control_complete); static DECLARE_COMPLETION(w1_control_complete);
static DECLARE_WAIT_QUEUE_HEAD(w1_control_wait);
static int w1_master_match(struct device *dev, struct device_driver *drv) static int w1_master_match(struct device *dev, struct device_driver *drv)
{ {
...@@ -649,7 +648,7 @@ int w1_control(void *data) ...@@ -649,7 +648,7 @@ int w1_control(void *data)
struct w1_slave *sl; struct w1_slave *sl;
struct w1_master *dev; struct w1_master *dev;
struct list_head *ent, *ment, *n, *mn; struct list_head *ent, *ment, *n, *mn;
int err, have_to_wait = 0, timeout; int err, have_to_wait = 0;
daemonize("w1_control"); daemonize("w1_control");
allow_signal(SIGTERM); allow_signal(SIGTERM);
...@@ -657,11 +656,8 @@ int w1_control(void *data) ...@@ -657,11 +656,8 @@ int w1_control(void *data)
while (!control_needs_exit || have_to_wait) { while (!control_needs_exit || have_to_wait) {
have_to_wait = 0; have_to_wait = 0;
timeout = w1_timeout*HZ; try_to_freeze(PF_FREEZE);
do { msleep_interruptible(w1_timeout * 1000);
timeout = interruptible_sleep_on_timeout(&w1_control_wait, timeout);
try_to_freeze(PF_FREEZE);
} while (!signal_pending(current) && (timeout > 0));
if (signal_pending(current)) if (signal_pending(current))
flush_signals(current); flush_signals(current);
...@@ -721,7 +717,6 @@ int w1_control(void *data) ...@@ -721,7 +717,6 @@ int w1_control(void *data)
int w1_process(void *data) int w1_process(void *data)
{ {
struct w1_master *dev = (struct w1_master *) data; struct w1_master *dev = (struct w1_master *) data;
unsigned long timeout;
struct list_head *ent, *n; struct list_head *ent, *n;
struct w1_slave *sl; struct w1_slave *sl;
...@@ -729,11 +724,8 @@ int w1_process(void *data) ...@@ -729,11 +724,8 @@ int w1_process(void *data)
allow_signal(SIGTERM); allow_signal(SIGTERM);
while (!dev->need_exit) { while (!dev->need_exit) {
timeout = w1_timeout*HZ; try_to_freeze(PF_FREEZE);
do { msleep_interruptible(w1_timeout * 1000);
timeout = interruptible_sleep_on_timeout(&dev->kwait, timeout);
try_to_freeze(PF_FREEZE);
} while (!signal_pending(current) && (timeout > 0));
if (signal_pending(current)) if (signal_pending(current))
flush_signals(current); flush_signals(current);
......
...@@ -115,7 +115,6 @@ struct w1_master ...@@ -115,7 +115,6 @@ struct w1_master
int need_exit; int need_exit;
pid_t kpid; pid_t kpid;
wait_queue_head_t kwait;
struct semaphore mutex; struct semaphore mutex;
struct device_driver *driver; struct device_driver *driver;
......
...@@ -74,7 +74,6 @@ struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl, ...@@ -74,7 +74,6 @@ struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
INIT_LIST_HEAD(&dev->slist); INIT_LIST_HEAD(&dev->slist);
init_MUTEX(&dev->mutex); init_MUTEX(&dev->mutex);
init_waitqueue_head(&dev->kwait);
init_completion(&dev->dev_released); init_completion(&dev->dev_released);
init_completion(&dev->dev_exited); init_completion(&dev->dev_exited);
......
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