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

diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c
index 1db8b68a8f64..e3f415b5e2a2 100644
--- a/drivers/iio/adc/hx711.c
+++ b/drivers/iio/adc/hx711.c
@@ -372,8 +372,9 @@ static irqreturn_t hx711_trigger(int irq, void *p)
 		j++;
 	}
 
-	iio_push_to_buffers_with_timestamp(indio_dev, &hx711_data->buffer,
-							pf->timestamp);
+	iio_push_to_buffers_with_ts(indio_dev, &hx711_data->buffer,
+						sizeof(hx711->buffer),
+						pf->timestamp);
 
 	mutex_unlock(&hx711_data->lock);
 
-- 
2.43.0