public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre•com>
To: "Jyoti Bhayana" <jbhayana@google•com>,
	"Jonathan Cameron" <jic23@kernel•org>,
	"Nuno Sá" <nuno.sa@analog•com>,
	"Andy Shevchenko" <andy@kernel•org>,
	"Nicolas Ferre" <nicolas.ferre@microchip•com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin•com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon•dev>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail•com>,
	"Alexandre Torgue" <alexandre.torgue@foss•st.com>,
	"Benson Leung" <bleung@chromium•org>,
	"Guenter Roeck" <groeck@chromium•org>
Cc: David Lechner <dlechner@baylibre•com>,
	linux-iio@vger•kernel.org, linux-kernel@vger•kernel.org,
	linux-arm-kernel@lists•infradead.org,
	linux-stm32@st-md-mailman•stormreply.com,
	chrome-platform@lists•linux.dev,
	Andy Shevchenko <andriy.shevchenko@linux•intel.com>
Subject: [PATCH] iio: pressure: cros_ec_baro: simplify timestamp channel definition
Date: Sun, 24 May 2026 20:46:52 -0500	[thread overview]
Message-ID: <20260525014654.2399354-1-dlechner@baylibre.com> (raw)
In-Reply-To: <20260524-iio-timestamp-cleanup-v2-0-c37c9408b7f7@baylibre.com>

Use IIO_CHAN_SOFT_TIMESTAMP() to define the timestamp channel instead of
manually filling in the struct iio_chan_spec fields. This makes the code
less verbose and mistake-prone.

Also drop obvious comment while we're at it.

Signed-off-by: David Lechner <dlechner@baylibre•com>
---
 drivers/iio/pressure/cros_ec_baro.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/iio/pressure/cros_ec_baro.c b/drivers/iio/pressure/cros_ec_baro.c
index c6b950c596c1..6cbde48d5be3 100644
--- a/drivers/iio/pressure/cros_ec_baro.c
+++ b/drivers/iio/pressure/cros_ec_baro.c
@@ -170,14 +170,8 @@ static int cros_ec_baro_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	/* Timestamp */
 	channel++;
-	channel->type = IIO_TIMESTAMP;
-	channel->channel = -1;
-	channel->scan_index = 1;
-	channel->scan_type.sign = 's';
-	channel->scan_type.realbits = 64;
-	channel->scan_type.storagebits = 64;
+	*channel = IIO_CHAN_SOFT_TIMESTAMP(1);
 
 	indio_dev->channels = state->channels;
 	indio_dev->num_channels = CROS_EC_BARO_MAX_CHANNELS;
-- 
2.43.0



  parent reply	other threads:[~2026-05-25  1:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25  1:38 [PATCH v2 0/9] iio: timestamp declaration cleanup David Lechner
2026-05-25  1:38 ` [PATCH v2 1/9] iio: Convert IIO_CHAN_SOFT_TIMESTAMP() to be compound literal David Lechner
2026-05-25  1:38 ` [PATCH v2 2/9] iio: common: scmi_sensors: simplify timestamp channel definition David Lechner
2026-05-25  1:38 ` [PATCH v2 3/9] iio: adc: dln2-adc: " David Lechner
2026-05-25  1:38 ` [PATCH v2 4/9] iio: adc: at91_adc: " David Lechner
2026-05-25  1:38 ` [PATCH v2 5/9] iio: adc: cc10001_adc: " David Lechner
2026-05-25  1:38 ` [PATCH v2 6/9] iio: adc: stm32-adc: " David Lechner
2026-05-25  1:38 ` [PATCH v2 7/9] iio: common: cros_ec_sensors: " David Lechner
2026-05-25  1:38 ` [PATCH v2 8/9] iio: light: cros_ec_light_prox: " David Lechner
2026-05-25  1:46 ` David Lechner [this message]
2026-05-25  1:49   ` [PATCH] iio: pressure: cros_ec_baro: " David Lechner
2026-05-26 18:12     ` Jonathan Cameron
2026-05-28  6:40   ` kernel test robot
2026-05-28 13:09     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260525014654.2399354-1-dlechner@baylibre.com \
    --to=dlechner@baylibre$(echo .)com \
    --cc=alexandre.belloni@bootlin$(echo .)com \
    --cc=alexandre.torgue@foss$(echo .)st.com \
    --cc=andriy.shevchenko@linux$(echo .)intel.com \
    --cc=andy@kernel$(echo .)org \
    --cc=bleung@chromium$(echo .)org \
    --cc=chrome-platform@lists$(echo .)linux.dev \
    --cc=claudiu.beznea@tuxon$(echo .)dev \
    --cc=groeck@chromium$(echo .)org \
    --cc=jbhayana@google$(echo .)com \
    --cc=jic23@kernel$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-iio@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-stm32@st-md-mailman$(echo .)stormreply.com \
    --cc=mcoquelin.stm32@gmail$(echo .)com \
    --cc=nicolas.ferre@microchip$(echo .)com \
    --cc=nuno.sa@analog$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox