]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: light: cros_ec_light_prox: simplify timestamp channel definition
authorDavid Lechner <dlechner@baylibre.com>
Mon, 25 May 2026 01:38:40 +0000 (20:38 -0500)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 10:01:49 +0000 (11:01 +0100)
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>
drivers/iio/light/cros_ec_light_prox.c

index 815806ceb5c89dde841d4f9d551a02ece51c6c5d..d09dea9c07825f97a4841cab8a4cd917aa894334 100644 (file)
@@ -223,14 +223,8 @@ static int cros_ec_light_prox_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;