* [PATCH] iio: buffer-dmaengine: remove non managed alloc/free
@ 2020-09-23 12:18 Alexandru Ardelean
2020-09-25 12:31 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Alexandru Ardelean @ 2020-09-23 12:18 UTC (permalink / raw)
To: linux-iio, linux-kernel; +Cc: jic23, lars, Alexandru Ardelean
This is to encourage the use of devm_iio_dmaengine_buffer_alloc().
Currently the managed version of the DMAEngine buffer alloc is the only
function used from this part of the framework.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
drivers/iio/buffer/industrialio-buffer-dmaengine.c | 6 ++----
include/linux/iio/buffer-dmaengine.h | 4 ----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
index 5789bda0745b..93b4e9e6bb55 100644
--- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
+++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
@@ -159,7 +159,7 @@ static const struct attribute *iio_dmaengine_buffer_attrs[] = {
* Once done using the buffer iio_dmaengine_buffer_free() should be used to
* release it.
*/
-struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,
+static struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,
const char *channel)
{
struct dmaengine_buffer *dmaengine_buffer;
@@ -211,7 +211,6 @@ struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,
kfree(dmaengine_buffer);
return ERR_PTR(ret);
}
-EXPORT_SYMBOL(iio_dmaengine_buffer_alloc);
/**
* iio_dmaengine_buffer_free() - Free dmaengine buffer
@@ -219,7 +218,7 @@ EXPORT_SYMBOL(iio_dmaengine_buffer_alloc);
*
* Frees a buffer previously allocated with iio_dmaengine_buffer_alloc().
*/
-void iio_dmaengine_buffer_free(struct iio_buffer *buffer)
+static void iio_dmaengine_buffer_free(struct iio_buffer *buffer)
{
struct dmaengine_buffer *dmaengine_buffer =
iio_buffer_to_dmaengine_buffer(buffer);
@@ -229,7 +228,6 @@ void iio_dmaengine_buffer_free(struct iio_buffer *buffer)
iio_buffer_put(buffer);
}
-EXPORT_SYMBOL_GPL(iio_dmaengine_buffer_free);
static void __devm_iio_dmaengine_buffer_free(struct device *dev, void *res)
{
diff --git a/include/linux/iio/buffer-dmaengine.h b/include/linux/iio/buffer-dmaengine.h
index 0e503db71289..5b502291d6a4 100644
--- a/include/linux/iio/buffer-dmaengine.h
+++ b/include/linux/iio/buffer-dmaengine.h
@@ -10,10 +10,6 @@
struct iio_buffer;
struct device;
-struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,
- const char *channel);
-void iio_dmaengine_buffer_free(struct iio_buffer *buffer);
-
struct iio_buffer *devm_iio_dmaengine_buffer_alloc(struct device *dev,
const char *channel);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: buffer-dmaengine: remove non managed alloc/free
2020-09-23 12:18 [PATCH] iio: buffer-dmaengine: remove non managed alloc/free Alexandru Ardelean
@ 2020-09-25 12:31 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2020-09-25 12:31 UTC (permalink / raw)
To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel, lars
On Wed, 23 Sep 2020 15:18:10 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
> This is to encourage the use of devm_iio_dmaengine_buffer_alloc().
> Currently the managed version of the DMAEngine buffer alloc is the only
> function used from this part of the framework.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Make sense. We can bring it back again if a strong usecase
shows up.
Applied to the togreg branch of iio.git and pushed out as testing
as normal.
Thanks,
Jonathan
> ---
> drivers/iio/buffer/industrialio-buffer-dmaengine.c | 6 ++----
> include/linux/iio/buffer-dmaengine.h | 4 ----
> 2 files changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> index 5789bda0745b..93b4e9e6bb55 100644
> --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> @@ -159,7 +159,7 @@ static const struct attribute *iio_dmaengine_buffer_attrs[] = {
> * Once done using the buffer iio_dmaengine_buffer_free() should be used to
> * release it.
> */
> -struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,
> +static struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,
> const char *channel)
> {
> struct dmaengine_buffer *dmaengine_buffer;
> @@ -211,7 +211,6 @@ struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,
> kfree(dmaengine_buffer);
> return ERR_PTR(ret);
> }
> -EXPORT_SYMBOL(iio_dmaengine_buffer_alloc);
>
> /**
> * iio_dmaengine_buffer_free() - Free dmaengine buffer
> @@ -219,7 +218,7 @@ EXPORT_SYMBOL(iio_dmaengine_buffer_alloc);
> *
> * Frees a buffer previously allocated with iio_dmaengine_buffer_alloc().
> */
> -void iio_dmaengine_buffer_free(struct iio_buffer *buffer)
> +static void iio_dmaengine_buffer_free(struct iio_buffer *buffer)
> {
> struct dmaengine_buffer *dmaengine_buffer =
> iio_buffer_to_dmaengine_buffer(buffer);
> @@ -229,7 +228,6 @@ void iio_dmaengine_buffer_free(struct iio_buffer *buffer)
>
> iio_buffer_put(buffer);
> }
> -EXPORT_SYMBOL_GPL(iio_dmaengine_buffer_free);
>
> static void __devm_iio_dmaengine_buffer_free(struct device *dev, void *res)
> {
> diff --git a/include/linux/iio/buffer-dmaengine.h b/include/linux/iio/buffer-dmaengine.h
> index 0e503db71289..5b502291d6a4 100644
> --- a/include/linux/iio/buffer-dmaengine.h
> +++ b/include/linux/iio/buffer-dmaengine.h
> @@ -10,10 +10,6 @@
> struct iio_buffer;
> struct device;
>
> -struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,
> - const char *channel);
> -void iio_dmaengine_buffer_free(struct iio_buffer *buffer);
> -
> struct iio_buffer *devm_iio_dmaengine_buffer_alloc(struct device *dev,
> const char *channel);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-25 12:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23 12:18 [PATCH] iio: buffer-dmaengine: remove non managed alloc/free Alexandru Ardelean
2020-09-25 12:31 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).