[PATCH 08/11] iio: adc : ad799x : 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 08/11] iio: adc : ad799x : 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/ad799x.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c
index 108bb22162ef..6c0470037c55 100644
--- a/drivers/iio/adc/ad799x.c
+++ b/drivers/iio/adc/ad799x.c
@@ -221,8 +221,9 @@ static irqreturn_t ad799x_trigger_handler(int irq, void *p)
 	if (b_sent < 0)
 		goto out;
 
-	iio_push_to_buffers_with_timestamp(indio_dev, st->rx_buf,
-			iio_get_time_ns(indio_dev));
+	iio_push_to_buffers_with_ts(indio_dev, st->rx_buf,
+					sizeof(st->rx_buf),
+				iio_get_time_ns(indio_dev));
 out:
 	iio_trigger_notify_done(indio_dev->trig);
 
-- 
2.43.0