]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: adc: ti-adc161s626: use DMA-safe memory for spi_read()
authorDavid Lechner <dlechner@baylibre.com>
Sat, 14 Mar 2026 23:13:32 +0000 (18:13 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Mar 2026 20:45:18 +0000 (20:45 +0000)
commit768461517a28d80fe81ea4d5d03a90cd184ea6ad
treef0197793cf8fe9b7a4c139eb4264bab608f19dd6
parent24869650dff34a6fc8fd1cc91b2058a72f9abc95
iio: adc: ti-adc161s626: use DMA-safe memory for spi_read()

Add a DMA-safe buffer and use it for spi_read() instead of a stack
memory. All SPI buffers must be DMA-safe.

Since we only need up to 3 bytes, we just use a u8[] instead of __be16
and __be32 and change the conversion functions appropriately.

Fixes: 4d671b71beef ("iio: adc: ti-adc161s626: add support for TI 1-channel differential ADCs")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti-adc161s626.c