Skip to content

Commit 165aea8

Browse files
commodoJonathan Cameron
authored andcommitted
iio: cros_ec: use devm_iio_triggered_buffer_setup_ext()
This change switches to the new devm_iio_triggered_buffer_setup_ext() function and removes the iio_buffer_set_attrs() call, for assigning the HW FIFO attributes to the buffer. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20200929125949.69934-8-alexandru.ardelean@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent a2f2835 commit 165aea8

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,19 +353,22 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
353353
if (ret)
354354
return ret;
355355
} else {
356+
const struct attribute **fifo_attrs;
357+
358+
if (has_hw_fifo)
359+
fifo_attrs = cros_ec_sensor_fifo_attributes;
360+
else
361+
fifo_attrs = NULL;
362+
356363
/*
357364
* The only way to get samples in buffer is to set a
358365
* software trigger (systrig, hrtimer).
359366
*/
360-
ret = devm_iio_triggered_buffer_setup(
367+
ret = devm_iio_triggered_buffer_setup_ext(
361368
dev, indio_dev, NULL, trigger_capture,
362-
NULL);
369+
NULL, fifo_attrs);
363370
if (ret)
364371
return ret;
365-
366-
if (has_hw_fifo)
367-
iio_buffer_set_attrs(indio_dev->buffer,
368-
cros_ec_sensor_fifo_attributes);
369372
}
370373
}
371374

0 commit comments

Comments
 (0)