mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
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:
parent
404edaf1e8
commit
b3405ec849
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user