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

iio: buffer-dmaengine: make use of the 'struct device *' argument

Respect the @dev argument in devm_iio_dmaengine_buffer_setup() and bind the
IIO DMA buffer lifetime to that device.

For the only user of this function, the IIO parent device is the
struct device being passed to the API so no real fix in here (just
consistency with other IIO APIs).

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240109-dmaengine_use_device-v1-1-1cbdb7fe9f29@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Nuno Sa and committed by
Jonathan Cameron
82cc6318 e7748c17

+1 -2
+1 -2
drivers/iio/buffer/industrialio-buffer-dmaengine.c
··· 279 279 { 280 280 struct iio_buffer *buffer; 281 281 282 - buffer = devm_iio_dmaengine_buffer_alloc(indio_dev->dev.parent, 283 - channel); 282 + buffer = devm_iio_dmaengine_buffer_alloc(dev, channel); 284 283 if (IS_ERR(buffer)) 285 284 return PTR_ERR(buffer); 286 285