Skip to contentSkip to conversation

iio: gyro: convert to iio_push_to_buffers_with_ts()

PATCH In review Gabriel Rondon 3 participants 6 messages Aug 21 – Aug 23

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover iio: gyro: convert to iio_push_to_buffers_with_ts()

Convert the gyro drivers that still use the deprecated iio_push_to_buffers_with_timestamp() to iio_push_to_buffers_with_ts(), which takes and checks the destination buffer size.

Each pushes a struct with an aligned_s64 timestamp, so the change is passing sizeof() of that buffer at the push site. No functional change.

Gabriel Rondon (3):
iio: gyro: adxrs290: use iio_push_to_buffers_with_ts()
iio: gyro: bmg160: use iio_push_to_buffers_with_ts()
iio: gyro: itg3200: use iio_push_to_buffers_with_ts()

 drivers/iio/gyro/adxrs290.c       | 4 ++--
 drivers/iio/gyro/bmg160_core.c    | 4 ++--
 drivers/iio/gyro/itg3200_buffer.c | 3 ++-
 3 files changed, 6 insertions(+), 5 deletions(-)
Signature · 1 line
2.50.1 (Apple Git-155)
#1 lore raw

PATCH 1/3 iio: gyro: adxrs290: use iio_push_to_buffers_with_ts()

Replace the deprecated iio_push_to_buffers_with_timestamp() with iio_push_to_buffers_with_ts(), passing the size of the pushed buffer.

---
 drivers/iio/gyro/adxrs290.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/gyro/adxrs290.c +2 -2
index 563de2724396..b61cc81122a6 100644
@@ -502,8 +502,8 @@ static irqreturn_t adxrs290_trigger_handler(int irq, void *p)
 		if (ret < 0)
 			break;
 
-		iio_push_to_buffers_with_timestamp(indio_dev, &st->buffer,
-						   pf->timestamp);
+		iio_push_to_buffers_with_ts(indio_dev, &st->buffer,
+					    sizeof(st->buffer), pf->timestamp);
 	} while (0);
 
 	iio_trigger_notify_done(indio_dev->trig);
Signature · 1 line
2.50.1 (Apple Git-155)
#2 lore raw

PATCH 2/3 iio: gyro: bmg160: use iio_push_to_buffers_with_ts()

In reply to Gabriel Rondon

Replace the deprecated iio_push_to_buffers_with_timestamp() with iio_push_to_buffers_with_ts(), passing the size of the pushed buffer.

---
 drivers/iio/gyro/bmg160_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/gyro/bmg160_core.c +2 -2
index d611341a0e2a..b007f46d3fd6 100644
@@ -897,8 +897,8 @@ static irqreturn_t bmg160_trigger_handler(int irq, void *p)
 	if (ret < 0)
 		goto err;
 
-	iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
-					   pf->timestamp);
+	iio_push_to_buffers_with_ts(indio_dev, &data->scan,
+				    sizeof(data->scan), pf->timestamp);
 err:
 	iio_trigger_notify_done(indio_dev->trig);
 
Signature · 1 line
2.50.1 (Apple Git-155)
#3 lore raw

PATCH 3/3 iio: gyro: itg3200: use iio_push_to_buffers_with_ts()

In reply to Gabriel Rondon

Replace the deprecated iio_push_to_buffers_with_timestamp() with iio_push_to_buffers_with_ts(), passing the size of the pushed buffer.

---
 drivers/iio/gyro/itg3200_buffer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/gyro/itg3200_buffer.c +2 -1
index 87efa2c74ca4..426d04d496b4 100644
@@ -59,7 +59,8 @@ static irqreturn_t itg3200_trigger_handler(int irq, void *p)
 	if (ret < 0)
 		goto error_ret;
 
-	iio_push_to_buffers_with_timestamp(indio_dev, &scan, pf->timestamp);
+	iio_push_to_buffers_with_ts(indio_dev, &scan, sizeof(scan),
+				    pf->timestamp);
 
 error_ret:
 	iio_trigger_notify_done(indio_dev->trig);
Signature · 1 line
2.50.1 (Apple Git-155)
reviewer Reviewed-by on the v1 series
#4 lore raw
In reply to Gabriel Rondon
Quoted 12 lines · Gabriel Rondon

Convert the gyro drivers that still use the deprecated iio_push_to_buffers_with_timestamp() to iio_push_to_buffers_with_ts(), which takes and checks the destination buffer size.

Each pushes a struct with an aligned_s64 timestamp, so the change is passing sizeof() of that buffer at the push site. No functional change.

Gabriel Rondon (3):
iio: gyro: adxrs290: use iio_push_to_buffers_with_ts()
iio: gyro: bmg160: use iio_push_to_buffers_with_ts()
iio: gyro: itg3200: use iio_push_to_buffers_with_ts()

Quoted 5 lines
 drivers/iio/gyro/adxrs290.c       | 4 ++--
 drivers/iio/gyro/bmg160_core.c    | 4 ++--
 drivers/iio/gyro/itg3200_buffer.c | 3 ++-
 3 files changed, 6 insertions(+), 5 deletions(-)

These check out. I also looked for alignment/DMA issues.

maintainer
#5 lore raw
Quoted 19 lines · On Sat, 22 Aug 2026 18:25:57 -0500 David Lechner <[email protected]> wrote:
Quoted 12 lines · Gabriel Rondon

Convert the gyro drivers that still use the deprecated iio_push_to_buffers_with_timestamp() to iio_push_to_buffers_with_ts(), which takes and checks the destination buffer size.

Each pushes a struct with an aligned_s64 timestamp, so the change is passing sizeof() of that buffer at the push site. No functional change.

Gabriel Rondon (3):
iio: gyro: adxrs290: use iio_push_to_buffers_with_ts()
iio: gyro: bmg160: use iio_push_to_buffers_with_ts()
iio: gyro: itg3200: use iio_push_to_buffers_with_ts()

Quoted 5 lines
 drivers/iio/gyro/adxrs290.c       | 4 ++--
 drivers/iio/gyro/bmg160_core.c    | 4 ++--
 drivers/iio/gyro/itg3200_buffer.c | 3 ++-
 3 files changed, 6 insertions(+), 5 deletions(-)
Quoted 4 lines

These check out. I also looked for alignment/DMA issues.

Applied to the testing branch of iio.git. I'll rebase that on rc1 when that is available and then it will go out as togreg for linux-next to pick up.

Nice little series.

Thanks,

Jonathan

Quoted 1 line