Skip to content

Commit 391c3ec

Browse files
dlechjic23
authored andcommitted
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>
1 parent 6a0861c commit 391c3ec

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

drivers/iio/pressure/cros_ec_baro.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,8 @@ static int cros_ec_baro_probe(struct platform_device *pdev)
170170
return -EINVAL;
171171
}
172172

173-
/* Timestamp */
174173
channel++;
175-
channel->type = IIO_TIMESTAMP;
176-
channel->channel = -1;
177-
channel->scan_index = 1;
178-
channel->scan_type.sign = 's';
179-
channel->scan_type.realbits = 64;
180-
channel->scan_type.storagebits = 64;
174+
*channel = IIO_CHAN_SOFT_TIMESTAMP(1);
181175

182176
indio_dev->channels = state->channels;
183177
indio_dev->num_channels = CROS_EC_BARO_MAX_CHANNELS;

0 commit comments

Comments
 (0)