]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: buffer-dma: Turn iio_dma_buffer_init() void
authorNuno Sá <nuno.sa@analog.com>
Fri, 19 Dec 2025 15:28:14 +0000 (15:28 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 21 Dec 2025 11:58:01 +0000 (11:58 +0000)
iio_dma_buffer_init() always return 0. Therefore there's no point in
returning int.

While at it, fix a mismatch between the function declaration and definition
regarding the struct device (dma_dev != dev).

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/buffer/industrialio-buffer-dma.c
include/linux/iio/buffer-dma.h

index 49d1bff5242a87d91cfdf9d4b40ca52cafeceee4..ed187bb23708eafd51556e49cd9d1eef2060d3e2 100644 (file)
@@ -826,8 +826,8 @@ EXPORT_SYMBOL_NS_GPL(iio_dma_buffer_set_length, "IIO_DMA_BUFFER");
  * should refer to the device that will perform the DMA to ensure that
  * allocations are done from a memory region that can be accessed by the device.
  */
-int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue,
-       struct device *dev, const struct iio_dma_buffer_ops *ops)
+void iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, struct device *dev,
+                        const struct iio_dma_buffer_ops *ops)
 {
        iio_buffer_init(&queue->buffer);
        queue->buffer.length = PAGE_SIZE;
@@ -839,8 +839,6 @@ int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue,
 
        mutex_init(&queue->lock);
        spin_lock_init(&queue->list_lock);
-
-       return 0;
 }
 EXPORT_SYMBOL_NS_GPL(iio_dma_buffer_init, "IIO_DMA_BUFFER");
 
index 4f33e6a39797d3ecfddc69c11d6d3985b9212920..cd2ba4bb75015b7c2d492f6c7f7b74e37d622ce0 100644 (file)
@@ -157,8 +157,8 @@ int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd);
 int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length);
 int iio_dma_buffer_request_update(struct iio_buffer *buffer);
 
-int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue,
-       struct device *dma_dev, const struct iio_dma_buffer_ops *ops);
+void iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, struct device *dev,
+                        const struct iio_dma_buffer_ops *ops);
 void iio_dma_buffer_exit(struct iio_dma_buffer_queue *queue);
 void iio_dma_buffer_release(struct iio_dma_buffer_queue *queue);