From cdef2e5f358db5fd27eec4c72eb295c232287813 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Thu, 2 Jan 2014 13:07:51 +0100 Subject: sound: oss: remove last sleep_on users There are three files in oss for which I could not find an easy way to replace interruptible_sleep_on_timeout with a non-racy version. This patch instead just adds a private implementation of the function, now named oss_broken_sleep_on, and changes over the remaining users in sound/oss/ so we can remove the global interface. [fixed coding style warnings by tiwai] Signed-off-by: Arnd Bergmann Signed-off-by: Takashi Iwai --- sound/oss/sleep.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sound/oss/sleep.h (limited to 'sound/oss/sleep.h') diff --git a/sound/oss/sleep.h b/sound/oss/sleep.h new file mode 100644 index 000000000000..a20fc925a5ce --- /dev/null +++ b/sound/oss/sleep.h @@ -0,0 +1,18 @@ +#include + +/* + * Do not use. This is a replacement for the old + * "interruptible_sleep_on_timeout" function that has been + * deprecated for ages. All users should instead try to use + * wait_event_interruptible_timeout. + */ + +static inline long +oss_broken_sleep_on(wait_queue_head_t *q, long timeout) +{ + DEFINE_WAIT(wait); + prepare_to_wait(q, &wait, TASK_INTERRUPTIBLE); + timeout = schedule_timeout(timeout); + finish_wait(q, &wait); + return timeout; +} -- cgit v1.2.3