Re: [PATCH 2/2] iio: adc: ti-adc161s626: use DMA-safe memory for spi_read()
From: Jonathan Cameron
Date: Sat Mar 21 2026 - 16:45:25 EST
On Mon, 16 Mar 2026 16:05:19 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> On Sat, Mar 14, 2026 at 06:13:32PM -0500, David Lechner wrote:
> > 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.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
>
Applied and marked for stable with the following as amazingly enough I was
running a config where it didn't have this via another path so the build
failed.
Thanks,
J
diff --git a/drivers/iio/adc/ti-adc161s626.c b/drivers/iio/adc/ti-adc161s626.c
index 833a636a29bb..be1cc2e77862 100644
--- a/drivers/iio/adc/ti-adc161s626.c
+++ b/drivers/iio/adc/ti-adc161s626.c
@@ -15,6 +15,7 @@
#include <linux/init.h>
#include <linux/err.h>
#include <linux/spi/spi.h>
+#include <linux/unaligned.h>
#include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include <linux/iio/buffer.h>