aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/tidspbridge/include
diff options
context:
space:
mode:
authorGuzman Lugo, Fernando <x0095840@ti.com>2010-10-25 20:51:46 -0400
committerOmar Ramirez Luna <omar.ramirez@ti.com>2011-02-04 21:11:08 -0500
commit4097c4968cd60bf5c690455466731d11149fe43f (patch)
tree761e406cbf870c49aadf2ceb43a94490af9440d3 /drivers/staging/tidspbridge/include
parentebf53826e105f488f4f628703a108e98940d1dc5 (diff)
staging: tidspbridge: make sync_wait_on_event interruptible
So that avoid non-killable process. Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com> Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Diffstat (limited to 'drivers/staging/tidspbridge/include')
-rw-r--r--drivers/staging/tidspbridge/include/dspbridge/sync.h13
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
85static inline int sync_wait_on_event(struct sync_object *event, 86static 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/**