Commit 2be90fef authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by Greg Kroah-Hartman

drivers/staging: use current->state helpers

Call __set_current_state() instead of assigning the new state directly.
These interfaces also aid CONFIG_DEBUG_ATOMIC_SLEEP environments,
keeping track of who changed the state.
Signed-off-by: default avatarDavidlohr Bueso <dbueso@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1167ff91
...@@ -174,7 +174,7 @@ struct me_private_data { ...@@ -174,7 +174,7 @@ struct me_private_data {
static inline void sleep(unsigned sec) static inline void sleep(unsigned sec)
{ {
current->state = TASK_INTERRUPTIBLE; __set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(sec * HZ); schedule_timeout(sec * HZ);
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
*/ */
int dgnc_ms_sleep(ulong ms) int dgnc_ms_sleep(ulong ms)
{ {
current->state = TASK_INTERRUPTIBLE; __set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout((ms * HZ) / 1000); schedule_timeout((ms * HZ) / 1000);
return signal_pending(current); return signal_pending(current);
} }
......
...@@ -780,7 +780,7 @@ static void long_sleep(int ms) ...@@ -780,7 +780,7 @@ static void long_sleep(int ms)
if (in_interrupt()) { if (in_interrupt()) {
mdelay(ms); mdelay(ms);
} else { } else {
current->state = TASK_INTERRUPTIBLE; __set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout((ms * HZ + 999) / 1000); schedule_timeout((ms * HZ + 999) / 1000);
} }
} }
......
...@@ -157,7 +157,7 @@ static void __speakup_paste_selection(struct work_struct *work) ...@@ -157,7 +157,7 @@ static void __speakup_paste_selection(struct work_struct *work)
pasted += count; pasted += count;
} }
remove_wait_queue(&vc->paste_wait, &wait); remove_wait_queue(&vc->paste_wait, &wait);
current->state = TASK_RUNNING; __set_current_state(TASK_RUNNING);
tty_buffer_unlock_exclusive(&vc->port); tty_buffer_unlock_exclusive(&vc->port);
tty_ldisc_deref(ld); tty_ldisc_deref(ld);
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
* x - the number of seconds to sleep. * x - the number of seconds to sleep.
*/ */
#define SLEEP(x) \ #define SLEEP(x) \
do { current->state = TASK_INTERRUPTIBLE; \ do { __set_current_state(TASK_INTERRUPTIBLE); \
schedule_timeout((x)*HZ); \ schedule_timeout((x)*HZ); \
} while (0) } while (0)
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
* x - the number of jiffies to sleep. * x - the number of jiffies to sleep.
*/ */
#define SLEEPJIFFIES(x) \ #define SLEEPJIFFIES(x) \
do { current->state = TASK_INTERRUPTIBLE; \ do { __set_current_state(TASK_INTERRUPTIBLE); \
schedule_timeout(x); \ schedule_timeout(x); \
} while (0) } while (0)
......
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