diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2016-08-05 09:39:34 -0400 |
---|---|---|
committer | Sumit Semwal <sumit.semwal@linaro.org> | 2016-08-11 06:03:23 -0400 |
commit | e1aaf311dbe82221910cc0e0809c988de210cc3c (patch) | |
tree | 942432e8bdf1eed9f9cdaca00711604f571c9d8f | |
parent | 9622c38f1cbab00aa2f52715ec950c5c5f838aa5 (diff) |
dma-buf/fence-array: add fence_is_array()
Add helper to check if fence is array.
v2: Comments from Chris Wilson
- remove ternary if from ops comparison
- add EXPORT_SYMBOL(fence_array_ops)
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
-rw-r--r-- | drivers/dma-buf/fence-array.c | 1 | ||||
-rw-r--r-- | include/linux/fence-array.h | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/dma-buf/fence-array.c b/drivers/dma-buf/fence-array.c index a8731c853da6..ee500226197b 100644 --- a/drivers/dma-buf/fence-array.c +++ b/drivers/dma-buf/fence-array.c | |||
@@ -99,6 +99,7 @@ const struct fence_ops fence_array_ops = { | |||
99 | .wait = fence_default_wait, | 99 | .wait = fence_default_wait, |
100 | .release = fence_array_release, | 100 | .release = fence_array_release, |
101 | }; | 101 | }; |
102 | EXPORT_SYMBOL(fence_array_ops); | ||
102 | 103 | ||
103 | /** | 104 | /** |
104 | * fence_array_create - Create a custom fence array | 105 | * fence_array_create - Create a custom fence array |
diff --git a/include/linux/fence-array.h b/include/linux/fence-array.h index 86baaa45567c..a44794e508df 100644 --- a/include/linux/fence-array.h +++ b/include/linux/fence-array.h | |||
@@ -52,6 +52,16 @@ struct fence_array { | |||
52 | extern const struct fence_ops fence_array_ops; | 52 | extern const struct fence_ops fence_array_ops; |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * fence_is_array - check if a fence is from the array subsclass | ||
56 | * | ||
57 | * Return true if it is a fence_array and false otherwise. | ||
58 | */ | ||
59 | static inline bool fence_is_array(struct fence *fence) | ||
60 | { | ||
61 | return fence->ops == &fence_array_ops; | ||
62 | } | ||
63 | |||
64 | /** | ||
55 | * to_fence_array - cast a fence to a fence_array | 65 | * to_fence_array - cast a fence to a fence_array |
56 | * @fence: fence to cast to a fence_array | 66 | * @fence: fence to cast to a fence_array |
57 | * | 67 | * |