Skip to content

Commit 6a0861c

Browse files
dlechjic23
authored andcommitted
iio: light: cros_ec_light_prox: 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>
1 parent b3405ec commit 6a0861c

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

drivers/iio/light/cros_ec_light_prox.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,8 @@ static int cros_ec_light_prox_probe(struct platform_device *pdev)
223223
return -EINVAL;
224224
}
225225

226-
/* Timestamp */
227226
channel++;
228-
channel->type = IIO_TIMESTAMP;
229-
channel->channel = -1;
230-
channel->scan_index = 1;
231-
channel->scan_type.sign = 's';
232-
channel->scan_type.realbits = 64;
233-
channel->scan_type.storagebits = 64;
227+
*channel = IIO_CHAN_SOFT_TIMESTAMP(1);
234228

235229
indio_dev->channels = state->channels;
236230

0 commit comments

Comments
 (0)