iio: adc: replace deprecated iio_push_to_buffers_with_timestamp()
Subsystems (4)
cover iio: adc: replace deprecated iio_push_to_buffers_with_timestamp()
Hello ,
The helper iio_push_to_buffers_with_timestamp() is deprecated in the IIO subsystem. The recommended replacement is iio_push_to_buffers_with_ts().
This patch series updates multiple ADC drivers to use the newer helper API. No functional changes are intended; the patches only replace the deprecated calls and adjust arguments where required.
The goal is to remove usage of the deprecated helper and keep the drivers aligned with the current IIO buffer interface.
Regards,
Atharv
---
Atharv Dubey (11):
iio: ad_sigma_delta: replace deprecated
iio_push_to_buffers_with_timestamp()
iio: ad7766: replace deprecated iio_push_to_buffers_with_timestamp()
iio: adc : ads7950 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : cc10001 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : ad7887 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : hx711 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : at91 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : ad799x : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : adc161s626 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : mt6360 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : ad7944 : replace deprecated
iio_push_to_buffers_with_timestamp()
drivers/iio/adc/ad7766.c | 4 ++-- drivers/iio/adc/ad7887.c | 4 ++-- drivers/iio/adc/ad7944.c | 10 ++++++---- drivers/iio/adc/ad799x.c | 5 +++-- drivers/iio/adc/ad_sigma_delta.c | 6 +++--- drivers/iio/adc/at91_adc.c | 2 +- drivers/iio/adc/cc10001_adc.c | 3 ++- drivers/iio/adc/hx711.c | 5 +++-- drivers/iio/adc/mt6360-adc.c | 2 +- drivers/iio/adc/ti-adc161s626.c | 5 +++-- drivers/iio/adc/ti-ads7950.c | 2 +- 11 files changed, 27 insertions(+), 21 deletions(-)
Signature · 1 line
2.43.0
cover iio: adc: replace deprecated iio_push_to_buffers_with_timestamp()
Hello ,
The helper iio_push_to_buffers_with_timestamp() is deprecated in the IIO subsystem. The recommended replacement is iio_push_to_buffers_with_ts().
This patch series updates multiple ADC drivers to use the newer helper API. No functional changes are intended; the patches only replace the deprecated calls and adjust arguments where required.
The goal is to remove usage of the deprecated helper and keep the drivers aligned with the current IIO buffer interface.
Regards,
Atharv
---
Atharv Dubey (11):
iio: ad_sigma_delta: replace deprecated
iio_push_to_buffers_with_timestamp()
iio: ad7766: replace deprecated iio_push_to_buffers_with_timestamp()
iio: adc : ads7950 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : cc10001 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : ad7887 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : hx711 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : at91 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : ad799x : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : adc161s626 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : mt6360 : replace deprecated
iio_push_to_buffers_with_timestamp()
iio: adc : ad7944 : replace deprecated
iio_push_to_buffers_with_timestamp()
drivers/iio/adc/ad7766.c | 4 ++-- drivers/iio/adc/ad7887.c | 4 ++-- drivers/iio/adc/ad7944.c | 10 ++++++---- drivers/iio/adc/ad799x.c | 5 +++-- drivers/iio/adc/ad_sigma_delta.c | 6 +++--- drivers/iio/adc/at91_adc.c | 2 +- drivers/iio/adc/cc10001_adc.c | 3 ++- drivers/iio/adc/hx711.c | 5 +++-- drivers/iio/adc/mt6360-adc.c | 2 +- drivers/iio/adc/ti-adc161s626.c | 5 +++-- drivers/iio/adc/ti-ads7950.c | 2 +- 11 files changed, 27 insertions(+), 21 deletions(-)
Signature · 1 line
2.43.0
Quoted 6 lines · Atharv Dubey
Hello ,
The helper
iio_push_to_buffers_with_timestamp()is deprecated in the IIO subsystem. The recommended replacement isiio_push_to_buffers_with_ts().
Quoted 6 lines
This patch series updates multiple ADC drivers to use the newer helper API. No functional changes are intended; the patches only replace the deprecated calls and adjust arguments where required.
The goal is to remove usage of the deprecated helper and keep the drivers aligned with the current IIO buffer interface.
You need to do this very carefully.
Besides that your email thread is broken:
- you have sent 2 time cover letter
- the patches 10 and 11 are detached from email thread.
On top of that there is wrong indentation in many places. I recommend you to choose something less tricky to begin with.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Hi Andy,
Quoted 13 lines · Andy Shevchenko
Quoted 6 lines · Atharv Dubey
Hello ,
The helper
iio_push_to_buffers_with_timestamp()is deprecated in the IIO subsystem. The recommended replacement isiio_push_to_buffers_with_ts().Quoted 6 lines
This patch series updates multiple ADC drivers to use the newer helper API. No functional changes are intended; the patches only replace the deprecated calls and adjust arguments where required.
The goal is to remove usage of the deprecated helper and keep the drivers aligned with the current IIO buffer interface.
Quoted 10 lines
You need to do this very carefully.
Besides that your email thread is broken:
- you have sent 2 time cover letter
- the patches 10 and 11 are detached from email thread.On top of that there is wrong indentation in many places. I recommend you to choose something less tricky to begin with.
I'll recitfy these mistakes and perhaps send a smaller patch for the same. If you have some more simpler things in mind , please let me know. I'll be happy to help out.
Regards,
Atharv
PATCH 1/11 iio: ad_sigma_delta: replace deprecated iio_push_to_buffers_with_timestamp()
In reply to Atharv Dubeyiio_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.
--- drivers/iio/adc/ad_sigma_delta.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/adc/ad_sigma_delta.c +3 -3
@@ -636,7 +636,7 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)* once, there is no need for sample number tracking. */ if (sigma_delta->active_slots ==1 ) { -iio_push_to_buffers_with_timestamp (indio_dev, data, pf->timestamp); +iio_push_to_buffers_with_ts (indio_dev, data,sizeof (data), pf->timestamp); goto irq_handled; }
@@ -662,8 +662,8 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)if (sigma_delta->current_slot == sigma_delta->active_slots) { sigma_delta->current_slot =0 ; -iio_push_to_buffers_with_timestamp (indio_dev, sigma_delta->samples_buf, - pf->timestamp); +iio_push_to_buffers_with_ts (indio_dev, sigma_delta->samples_buf, +sizeof (sigma_delta->sampkes_buf), pf->timestamp); } irq_handled:
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerRe: [PATCH 01/11] iio: ad_sigma_delta: replace deprecated iio_push_to_buffers_with_timestamp()
Quoted 5 lines · On Mon, 16 Mar 2026 22:57:27 +0530 Atharv Dubey <[email protected]> wrote:
iio_push_to_buffers_with_timestamp()is deprecated. Replace it withiio_push_to_buffers_with_ts(), which takes the buffer size as an argument and helps avoid potential buffer overflows.Signed-off-by Atharv Dubey <[email protected]>
Hi Atharv,
Thank for you for your patch.
Quoted 9 lines
--- drivers/iio/adc/ad_sigma_delta.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/iio/adc/ad_sigma_delta.c +0
-0
drivers/iio/adc/ad_sigma_delta.c static irqreturn_t ad_sd_trigger_handler(int irq, void *p) · line 639
Quoted 5 lines
drivers/iio/adc/ad_sigma_delta.c +1
-1@@ -636,7 +636,7 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)* once, there is no need for sample number tracking. */ if (sigma_delta->active_slots ==1 ) { -iio_push_to_buffers_with_timestamp (indio_dev, data, pf->timestamp); +iio_push_to_buffers_with_ts (indio_dev, data,sizeof (data), pf->timestamp);
What is sizeof(data) and why is that the right value to pass as the new parameter?
drivers/iio/adc/ad_sigma_delta.c static irqreturn_t ad_sd_trigger_handler(int irq, void *p) · line 666
Quoted 11 lines
drivers/iio/adc/ad_sigma_delta.c +2
-2goto irq_handled; }@@ -662,8 +662,8 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)if (sigma_delta->current_slot == sigma_delta->active_slots) { sigma_delta->current_slot =0 ; -iio_push_to_buffers_with_timestamp (indio_dev, sigma_delta->samples_buf, - pf->timestamp); +iio_push_to_buffers_with_ts (indio_dev, sigma_delta->samples_buf, +sizeof (sigma_delta->sampkes_buf), pf->timestamp);
Likewise. What value does the new parameter take?
I'm not going to review any more of this version of the series given these are both incorrect in the first patch.
Jonathan
Quoted 3 lines
drivers/iio/adc/ad_sigma_delta.c +0
-0} irq_handled:
Re: [PATCH 01/11] iio: ad_sigma_delta: replace deprecated iio_push_to_buffers_with_timestamp()
Hi Jonathan,
Quoted 42 lines · Jonathan Cameron
Quoted 5 lines · On Mon, 16 Mar 2026 22:57:27 +0530 Atharv Dubey <[email protected]> wrote:
iio_push_to_buffers_with_timestamp()is deprecated. Replace it withiio_push_to_buffers_with_ts(), which takes the buffer size as an argument and helps avoid potential buffer overflows.Signed-off-by Atharv Dubey <[email protected]>Hi Atharv,
Thank for you for your patch.
Quoted 9 lines
--- drivers/iio/adc/ad_sigma_delta.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/iio/adc/ad_sigma_delta.c +0
-0drivers/iio/adc/ad_sigma_delta.c static irqreturn_t ad_sd_trigger_handler(int irq, void *p) · line 639
Quoted 5 lines
drivers/iio/adc/ad_sigma_delta.c +1
-1@@ -636,7 +636,7 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)* once, there is no need for sample number tracking. */ if (sigma_delta->active_slots ==1 ) { -iio_push_to_buffers_with_timestamp (indio_dev, data, pf->timestamp); +iio_push_to_buffers_with_ts (indio_dev, data,sizeof (data), pf->timestamp);What is sizeof(data) and why is that the right value to pass as the new parameter?
drivers/iio/adc/ad_sigma_delta.c static irqreturn_t ad_sd_trigger_handler(int irq, void *p) · line 666
Quoted 11 lines
drivers/iio/adc/ad_sigma_delta.c +2
-2goto irq_handled; }@@ -662,8 +662,8 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)if (sigma_delta->current_slot == sigma_delta->active_slots) { sigma_delta->current_slot =0 ; -iio_push_to_buffers_with_timestamp (indio_dev, sigma_delta->samples_buf, - pf->timestamp); +iio_push_to_buffers_with_ts (indio_dev, sigma_delta->samples_buf, +sizeof (sigma_delta->sampkes_buf), pf->timestamp);Likewise. What value does the new parameter take?
Quoted 4 lines
I'm not going to review any more of this version of the series given these are both incorrect in the first patch.
Jonathan
You are right, both the fixes are incorrect let me try more on this. I'll send a smaller patch series first and mark it as an RFC.
Quoted 5 lines
drivers/iio/adc/ad_sigma_delta.c static irqreturn_t ad_sd_trigger_handler(int irq, void *p) · line 669
Quoted 4 lines
drivers/iio/adc/ad_sigma_delta.c +0
-0} irq_handled:
Regards,
Atharv
PATCH 2/11 iio: ad7766: replace deprecated iio_push_to_buffers_with_timestamp()
In reply to Atharv Dubeyiio_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.
--- drivers/iio/adc/ad7766.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ad7766.c +2 -2
@@ -74,8 +74,8 @@ static irqreturn_t ad7766_trigger_handler(int irq, void *p)if (ret <0 ) goto done; -iio_push_to_buffers_with_timestamp (indio_dev, ad7766->data, - pf->timestamp); +iio_push_to_buffers_with_ts (indio_dev, ad7766->data, +sizeof (ad7766->data), pf->timestamp); done:iio_trigger_notify_done (indio_dev->trig);
Signature · 1 line
2.43.0
PATCH 3/11 iio: adc : ads7950 : replace deprecated iio_push_to_buffers_with_timestamp()
In reply to Atharv Dubeyiio_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.
--- drivers/iio/adc/ti-ads7950.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-ads7950.c +1 -1
@@ -313,7 +313,7 @@ static irqreturn_t ti_ads7950_trigger_handler(int irq, void *p)if (ret <0 ) goto out; -iio_push_to_buffers_with_timestamp (indio_dev, &st->rx_buf[2 ], + iio_push_to_buffers_with_ts(indio_dev, &st->rx_buf[2], sizeof(st->rx_buf)iio_get_time_ns (indio_dev)); out:
Signature · 1 line
2.43.0
PATCH 4/11 iio: adc : cc10001 : replace deprecated iio_push_to_buffers_with_timestamp()
In reply to Atharv Dubeyiio_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.
--- drivers/iio/adc/cc10001_adc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/adc/cc10001_adc.c +2 -1
@@ -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);
Signature · 1 line
2.43.0
PATCH 5/11 iio: adc : ad7887 : replace deprecated iio_push_to_buffers_with_timestamp()
In reply to Atharv Dubeyiio_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.
--- drivers/iio/adc/ad7887.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ad7887.c +2 -2
@@ -119,8 +119,8 @@ static irqreturn_t ad7887_trigger_handler(int irq, void *p)if (b_sent) goto done; -iio_push_to_buffers_with_timestamp (indio_dev, st->data, -iio_get_time_ns (indio_dev)); +iio_push_to_buffers_with_ts (indio_dev, st->data, +sizeof (st->data),iio_get_time_ns (indio_dev)); done:iio_trigger_notify_done (indio_dev->trig);
Signature · 1 line
2.43.0
PATCH 6/11 iio: adc : hx711 : replace deprecated iio_push_to_buffers_with_timestamp()
In reply to Atharv Dubeyiio_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.
--- drivers/iio/adc/hx711.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/iio/adc/hx711.c +3 -2
@@ -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);
Signature · 1 line
2.43.0
PATCH 7/11 iio: adc : at91 : replace deprecated iio_push_to_buffers_with_timestamp()
In reply to Atharv Dubeyiio_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.
--- drivers/iio/adc/at91_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/at91_adc.c +1 -1
@@ -275,7 +275,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p) j++; } -iio_push_to_buffers_with_timestamp (idev, st->buffer, pf->timestamp); +iio_push_to_buffers_with_ts (idev, st->buffer,sizeof (st->buffer), pf->timestamp);iio_trigger_notify_done (idev->trig);
Signature · 1 line
2.43.0
PATCH 8/11 iio: adc : ad799x : replace deprecated iio_push_to_buffers_with_timestamp()
In reply to Atharv Dubeyiio_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.
--- drivers/iio/adc/ad799x.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/iio/adc/ad799x.c +3 -2
@@ -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);
Signature · 1 line
2.43.0
PATCH 9/11 iio: adc : adc161s626 : replace deprecated iio_push_to_buffers_with_timestamp()
In reply to Atharv Dubeyiio_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.
--- drivers/iio/adc/ti-adc161s626.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/iio/adc/ti-adc161s626.c +3 -2
@@ -119,8 +119,9 @@ static irqreturn_t ti_adc_trigger_handler(int irq, void *private) ret =ti_adc_read_measurement (data, &indio_dev->channels[0 ], (int *) &data->buffer);if (!ret) -iio_push_to_buffers_with_timestamp (indio_dev, - data->buffer, +iio_push_to_buffers_with_ts (indio_dev, + data->buffer, +sizeof (data->buffer),iio_get_time_ns (indio_dev));iio_trigger_notify_done (indio_dev->trig);
Signature · 1 line
2.43.0