iio: common: cros_ec_sensors: 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>
This commit is contained in:
David Lechner 2026-05-24 20:38:39 -05:00 committed by Jonathan Cameron
parent 404edaf1e8
commit b3405ec849
2 changed files with 2 additions and 14 deletions

View File

@ -279,13 +279,7 @@ static int cros_ec_sensors_probe(struct platform_device *pdev)
channel++;
}
/* Timestamp */
channel->scan_index = index;
channel->type = IIO_TIMESTAMP;
channel->channel = -1;
channel->scan_type.sign = 's';
channel->scan_type.realbits = 64;
channel->scan_type.storagebits = 64;
*channel = IIO_CHAN_SOFT_TIMESTAMP(index);
indio_dev->channels = st->channels;
indio_dev->num_channels = index + 1;

View File

@ -279,13 +279,7 @@ static int cros_ec_sensors_probe(struct platform_device *pdev)
}
}
/* Timestamp */
channel->type = IIO_TIMESTAMP;
channel->channel = -1;
channel->scan_index = CROS_EC_SENSOR_MAX_AXIS;
channel->scan_type.sign = 's';
channel->scan_type.realbits = 64;
channel->scan_type.storagebits = 64;
*channel = IIO_CHAN_SOFT_TIMESTAMP(CROS_EC_SENSOR_MAX_AXIS);
indio_dev->channels = state->channels;
indio_dev->num_channels = CROS_EC_SENSORS_MAX_CHANNELS;