[PATCH 04/11] iio: adc : cc10001 : replace deprecated iio_push_to_buffers_with_timestamp()

Atharv Dubey posted 11 patches 3 weeks ago
Only 9 patches received!
There is a newer version of this series
[PATCH 04/11] iio: adc : cc10001 : replace deprecated iio_push_to_buffers_with_timestamp()
Posted by Atharv Dubey 3 weeks ago
iio_push_to_buffers_with_timestamp() is deprecated. Replace it with
iio_push_to_buffers_with_ts(), which takes the buffer size as an
argument and helps avoid potential buffer overflows.

Signed-off-by: Atharv Dubey <atharvd440@gmail.com>
---
 drivers/iio/adc/cc10001_adc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/cc10001_adc.c b/drivers/iio/adc/cc10001_adc.c
index 2c51b90b7101..ef105458ffbd 100644
--- a/drivers/iio/adc/cc10001_adc.c
+++ b/drivers/iio/adc/cc10001_adc.c
@@ -178,7 +178,8 @@ static irqreturn_t cc10001_adc_trigger_h(int irq, void *p)
 	mutex_unlock(&adc_dev->lock);
 
 	if (!sample_invalid)
-		iio_push_to_buffers_with_timestamp(indio_dev, data,
+		iio_push_to_buffers_with_ts(indio_dev, data,
+						   sizeof(data),
 						   iio_get_time_ns(indio_dev));
 	iio_trigger_notify_done(indio_dev->trig);
 
-- 
2.43.0