| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| From: Sandeep Patil <sspatil@google.com> |
| Date: Tue, 10 Sep 2019 05:13:51 -0700 |
| Subject: ANDROID: staging: ion: export ion_free() for ion_heaps. |
| |
| ion_free() is a generic function needed to release |
| an ion buffer back to the heap. So, export it for the |
| heap module. |
| |
| Bug: 140294230 |
| Test: ion-unit-tests |
| |
| Change-Id: Iaa467ab3df18fa219412dd9f5913cd022a93455d |
| Signed-off-by: Sandeep Patil <sspatil@google.com> |
| --- |
| drivers/staging/android/ion/ion.c | 1 + |
| include/linux/ion.h | 12 ++++++++++++ |
| 2 files changed, 13 insertions(+) |
| |
| diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c |
| index db1a5850ccb0..68091d17cfb8 100644 |
| --- a/drivers/staging/android/ion/ion.c |
| +++ b/drivers/staging/android/ion/ion.c |
| @@ -41,6 +41,7 @@ int ion_free(struct ion_buffer *buffer) |
| { |
| return ion_buffer_destroy(internal_dev, buffer); |
| } |
| +EXPORT_SYMBOL_GPL(ion_free); |
| |
| static int ion_alloc_fd(size_t len, unsigned int heap_id_mask, |
| unsigned int flags) |
| diff --git a/include/linux/ion.h b/include/linux/ion.h |
| index 87aa2bcec7d3..88622fb8f9ea 100644 |
| --- a/include/linux/ion.h |
| +++ b/include/linux/ion.h |
| @@ -293,6 +293,13 @@ int ion_buffer_zero(struct ion_buffer *buffer); |
| struct dma_buf *ion_alloc(size_t len, unsigned int heap_id_mask, |
| unsigned int flags); |
| |
| +/** |
| + * ion_free - Releases the ion buffer. |
| + * |
| + * @buffer: ion buffer to be released |
| + */ |
| +int ion_free(struct ion_buffer *buffer); |
| + |
| #else |
| |
| static inline int __ion_device_add_heap(struct ion_heap *heap, |
| @@ -357,5 +364,10 @@ static inline struct dma_buf *ion_alloc(size_t len, unsigned int heap_id_mask, |
| return ERR_PTR(-ENOMEM); |
| } |
| |
| +static inline int ion_free(struct ion_buffer *buffer) |
| +{ |
| + return 0; |
| +} |
| + |
| #endif /* CONFIG_ION */ |
| #endif /* _ION_KERNEL_H */ |