public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
* [PATCH 0/8] iio: timestamp declaration cleanup
@ 2026-05-17 18:17 David Lechner
  2026-05-17 18:17 ` [PATCH 1/8] iio: common: scmi_sensors: simplify timestamp channel definition David Lechner
                   ` (10 more replies)
  0 siblings, 11 replies; 16+ messages in thread
From: David Lechner @ 2026-05-17 18:17 UTC (permalink / raw)
  To: Jyoti Bhayana, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Coquelin,
	Alexandre Torgue, Benson Leung, Guenter Roeck
  Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-stm32,
	chrome-platform, David Lechner

While looking around the code, I noticed that there are a lot of places
were we are manually filling all of the fields of an IIO timestamp.

This is error-prone (as seen in the first patch) and more verbose than
it needs to be.

I went with the approach of using the existing IIO_CHAN_SOFT_TIMESTAMP()
macro for doing a struct assignment. This does require a cast, which
makes it a bit more verbose, but we were already doing that in to
drivers, so I went with it anyway.

If we want to consider alternatives, we could make a iio helper function
or macro like the first and second patches did.

Signed-off-by: David Lechner <dlechner@baylibre•com>
---
David Lechner (8):
      iio: common: scmi_sensors: simplify timestamp channel definition
      iio: adc: dln2-adc: simplify timestamp channel definition
      iio: adc: at91_adc: simplify timestamp channel definition
      iio: adc: cc10001_adc: simplify timestamp channel definition
      iio: adc: stm32-adc: simplify timestamp channel definition
      iio: common: cros_ec_sensors: simplify timestamp channel definition
      iio: light: cros_ec_light_prox: simplify timestamp channel definition
      iio: pressure: cros_ec_baro: simplify timestamp channel definition

 drivers/iio/adc/at91_adc.c                            | 12 +++---------
 drivers/iio/adc/cc10001_adc.c                         | 10 ++--------
 drivers/iio/adc/dln2-adc.c                            | 12 +-----------
 drivers/iio/adc/stm32-adc.c                           | 10 ++--------
 drivers/iio/common/cros_ec_sensors/cros_ec_activity.c |  8 +-------
 drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c  |  8 +-------
 drivers/iio/common/scmi_sensors/scmi_iio.c            | 13 +------------
 drivers/iio/light/cros_ec_light_prox.c                |  8 +-------
 drivers/iio/pressure/cros_ec_baro.c                   |  8 +-------
 9 files changed, 13 insertions(+), 76 deletions(-)
---
base-commit: 8678fb54958893818ddeccd05fea560a4e1fc759
change-id: 20260517-iio-timestamp-cleanup-1ee82f081a70

Best regards,
--  
David Lechner <dlechner@baylibre•com>



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-05-18 15:45 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-17 18:17 [PATCH 0/8] iio: timestamp declaration cleanup David Lechner
2026-05-17 18:17 ` [PATCH 1/8] iio: common: scmi_sensors: simplify timestamp channel definition David Lechner
2026-05-17 18:17 ` [PATCH 2/8] iio: adc: dln2-adc: " David Lechner
2026-05-17 18:17 ` [PATCH 3/8] iio: adc: at91_adc: " David Lechner
2026-05-17 18:17 ` [PATCH 4/8] iio: adc: cc10001_adc: " David Lechner
2026-05-17 18:17 ` [PATCH 5/8] iio: adc: stm32-adc: " David Lechner
2026-05-17 18:17 ` [PATCH 6/8] iio: common: cros_ec_sensors: " David Lechner
2026-05-17 18:17 ` [PATCH 7/8] iio: light: cros_ec_light_prox: " David Lechner
2026-05-17 18:17 ` [PATCH 8/8] iio: pressure: cros_ec_baro: " David Lechner
2026-05-17 19:22 ` [PATCH 0/8] iio: timestamp declaration cleanup David Lechner
2026-05-18  7:23   ` Andy Shevchenko
2026-05-18  7:09 ` Andy Shevchenko
2026-05-18  7:14   ` Andy Shevchenko
2026-05-18 14:34     ` David Lechner
2026-05-18 15:44       ` Jonathan Cameron
2026-05-18  7:26 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox