Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: buffer-dma: Turn iio_dma_buffer_init() void

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>

authored by

Nuno Sá and committed by
Jonathan Cameron
247a357a 07d6dc17

+4 -6
+2 -4
drivers/iio/buffer/industrialio-buffer-dma.c
··· 826 826 * should refer to the device that will perform the DMA to ensure that 827 827 * allocations are done from a memory region that can be accessed by the device. 828 828 */ 829 - int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, 830 - struct device *dev, const struct iio_dma_buffer_ops *ops) 829 + void iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, struct device *dev, 830 + const struct iio_dma_buffer_ops *ops) 831 831 { 832 832 iio_buffer_init(&queue->buffer); 833 833 queue->buffer.length = PAGE_SIZE; ··· 839 839 840 840 mutex_init(&queue->lock); 841 841 spin_lock_init(&queue->list_lock); 842 - 843 - return 0; 844 842 } 845 843 EXPORT_SYMBOL_NS_GPL(iio_dma_buffer_init, "IIO_DMA_BUFFER"); 846 844
+2 -2
include/linux/iio/buffer-dma.h
··· 157 157 int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length); 158 158 int iio_dma_buffer_request_update(struct iio_buffer *buffer); 159 159 160 - int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, 161 - struct device *dma_dev, const struct iio_dma_buffer_ops *ops); 160 + void iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, struct device *dev, 161 + const struct iio_dma_buffer_ops *ops); 162 162 void iio_dma_buffer_exit(struct iio_dma_buffer_queue *queue); 163 163 void iio_dma_buffer_release(struct iio_dma_buffer_queue *queue); 164 164