]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: temperature: maxim_thermocouple: use DMA-safe buffer for spi_read()
authorDavid Lechner <dlechner@baylibre.com>
Sun, 24 Aug 2025 13:13:03 +0000 (09:13 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:16 +0000 (16:26 +0200)
commitad17c9692d6c1a40636cc0fa9c5ce63c73b16d2b
tree51a47513fd4b5b94e0a08c29a8b7c2004cc8bd15
parent83f14c4ca1ad78fcfb3e0de07d6d8a0c59550fc2
iio: temperature: maxim_thermocouple: use DMA-safe buffer for spi_read()

[ Upstream commit ae5bc07ec9f73a41734270ef3f800c5c8a7e0ad3 ]

Replace using stack-allocated buffers with a DMA-safe buffer for use
with spi_read(). This allows the driver to be safely used with
DMA-enabled SPI controllers.

The buffer array is also converted to a struct with a union to make the
usage of the memory in the buffer more clear and ensure proper alignment.

Fixes: 1f25ca11d84a ("iio: temperature: add support for Maxim thermocouple chips")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250721-iio-use-more-iio_declare_buffer_with_ts-3-v2-1-0c68d41ccf6c@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
[ iio_push_to_buffers_with_ts() => iio_push_to_buffers_with_timestamp() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/temperature/maxim_thermocouple.c