Commit | Line | Data |
---|---|---|
9a633d00 KZ |
1 | #include <linux/tty.h> |
2 | #include <linux/sched.h> | |
3 | #include "dgnc_utils.h" | |
9a633d00 KZ |
4 | |
5 | /* | |
6 | * dgnc_ms_sleep() | |
7 | * | |
8 | * Put the driver to sleep for x ms's | |
9 | * | |
10 | * Returns 0 if timed out, !0 (showing signal) if interrupted by a signal. | |
11 | */ | |
12 | int dgnc_ms_sleep(ulong ms) | |
13 | { | |
2be90fef | 14 | __set_current_state(TASK_INTERRUPTIBLE); |
9a633d00 KZ |
15 | schedule_timeout((ms * HZ) / 1000); |
16 | return signal_pending(current); | |
17 | } |