]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: proximity: sx9500: use stack allocated struct for scan data
authorDavid Lechner <dlechner@baylibre.com>
Tue, 22 Jul 2025 19:35:02 +0000 (14:35 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 16 Aug 2025 10:57:05 +0000 (11:57 +0100)
commit5335f93d28143b6288ca6d8cec1f05b033c456c1
treef0992482929edccc48e96196e2eb75cb313e4951
parentb76c739c3d11d1dacc8efe7fa873bee28ac991f1
iio: proximity: sx9500: use stack allocated struct for scan data

Use a stack-allocated struct in sx9500_trigger_handler() to hold the
IIO buffer scan data. Since the scan buffer isn't used outside of this
function, it doesn't need to be in struct sx9500_data.

By always allocating enough space for the maximum number of channels,
we can avoid having to reallocate the buffer each time buffered reads
are enabled.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250722-iio-use-more-iio_declare_buffer_with_ts-4-v2-1-9e566f3a4c6a@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/sx9500.c