• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/tty.h>
3 #include <linux/sched/signal.h>
4 #include "dgnc_utils.h"
5 
6 /**
7  * dgnc_ms_sleep - Put the driver to sleep
8  * @ms - milliseconds to sleep
9  *
10  * Return: 0 if timed out, if interrupted by a signal return signal.
11  */
dgnc_ms_sleep(ulong ms)12 int dgnc_ms_sleep(ulong ms)
13 {
14 	__set_current_state(TASK_INTERRUPTIBLE);
15 	schedule_timeout((ms * HZ) / 1000);
16 	return signal_pending(current);
17 }
18