iio: pressure: bmp280: drop sensor_data array
authorDavid Lechner <dlechner@baylibre.com>
Tue, 22 Apr 2025 19:28:36 +0000 (14:28 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 21 May 2025 13:20:28 +0000 (14:20 +0100)
commit872c8014e05ed47b8a7c0f5ba4311279a637150b
treea188400c96e48c9f3e309204d63a30e3a16bde75
parent162129a27c693230fd15531d083b4574c9101a6b
iio: pressure: bmp280: drop sensor_data array

Drop the sensor_data array from struct bmp280_data and replace it using
local structs in each interrupt handler.

The sensor_data array in struct bmp280_data is not used to share data
between functions and isn't used for DMA, so there isn't really a need
to have it in the struct. Instead, we can use the struct pattern for
scan data in each interrupt handler. This has the advantage of allowing
us to see the actual layout of each scan buffer for each different type
of supported sensor. It also avoid juggling values between local
variables and the array which makes the code a bit simpler by avoiding
some extra assignments.

We can also drop the BME280_NUM_MAX_CHANNELS macro as it is no longer
used.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Link: https://lore.kernel.org/linux-iio/20250421135540.1a667221@jic23-huawei/
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20250422-iio-pressure-bmp280-rework-push-to-buffers-v1-1-ee722f29aeca@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/bmp280-core.c
drivers/iio/pressure/bmp280.h