diff options
| author | David Lechner <dlechner@baylibre.com> | 2026-05-24 20:46:52 -0500 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2026-05-31 11:01:49 +0100 |
| commit | 391c3ec1b15e9f5880812cb045f470ac45c8ba8f (patch) | |
| tree | c5574e8d4ee2efa5f599211169f648597038a013 /drivers/iio | |
| parent | 6a0861ce6f725891e8f31971512915a7374a541e (diff) | |
| download | linux-next-391c3ec1b15e9f5880812cb045f470ac45c8ba8f.tar.gz linux-next-391c3ec1b15e9f5880812cb045f470ac45c8ba8f.zip | |
iio: pressure: cros_ec_baro: simplify timestamp channel definition
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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
| -rw-r--r-- | drivers/iio/pressure/cros_ec_baro.c | 8 |
1 files changed, 1 insertions, 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; |
