diff options
-rw-r--r-- | drivers/staging/tidspbridge/include/dspbridge/sync.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/staging/tidspbridge/include/dspbridge/sync.h b/drivers/staging/tidspbridge/include/dspbridge/sync.h index e2651e7b1c4..df05b8f8e23 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/sync.h +++ b/drivers/staging/tidspbridge/include/dspbridge/sync.h | |||
@@ -80,13 +80,22 @@ void sync_set_event(struct sync_object *event); | |||
80 | * This functios will wait until @event is set or until timeout. In case of | 80 | * This functios will wait until @event is set or until timeout. In case of |
81 | * success the function will return 0 and | 81 | * success the function will return 0 and |
82 | * in case of timeout the function will return -ETIME | 82 | * in case of timeout the function will return -ETIME |
83 | * in case of signal the function will return -ERESTARTSYS | ||
83 | */ | 84 | */ |
84 | 85 | ||
85 | static inline int sync_wait_on_event(struct sync_object *event, | 86 | static inline int sync_wait_on_event(struct sync_object *event, |
86 | unsigned timeout) | 87 | unsigned timeout) |
87 | { | 88 | { |
88 | return wait_for_completion_timeout(&event->comp, | 89 | int res; |
89 | msecs_to_jiffies(timeout)) ? 0 : -ETIME; | 90 | |
91 | res = wait_for_completion_interruptible_timeout(&event->comp, | ||
92 | msecs_to_jiffies(timeout)); | ||
93 | if (!res) | ||
94 | res = -ETIME; | ||
95 | else if (res > 0) | ||
96 | res = 0; | ||
97 | |||
98 | return res; | ||
90 | } | 99 | } |
91 | 100 | ||
92 | /** | 101 | /** |