Skip to content

Commit

Permalink
iio: buffer-dmaengine: remove non managed alloc/free
Browse files Browse the repository at this point in the history
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>
Link: https://lore.kernel.org/r/20200923121810.944075-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Alexandru Ardelean authored and Jonathan Cameron committed Sep 29, 2020
1 parent 57e5b8b commit 25918a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 2 additions & 4 deletions drivers/iio/buffer/industrialio-buffer-dmaengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -211,15 +211,14 @@ 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
* @buffer: Buffer to free
*
* 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);
Expand All @@ -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)
{
Expand Down
4 changes: 0 additions & 4 deletions include/linux/iio/buffer-dmaengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 25918a9

Please sign in to comment.