]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: light: acpi-als: Use iio_push_to_buffers_with_ts() to allow runtime source size...
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 2 Aug 2025 16:44:27 +0000 (17:44 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 16 Aug 2025 14:50:54 +0000 (15:50 +0100)
This function allows for runtime detection of undersized storage which
can be non obvious due to the injection of a timestamp within the helper.

Cc: Gwendal Grignou <gwendal@chromium.org>
Link: https://patch.msgid.link/20250802164436.515988-8-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
drivers/iio/light/acpi-als.c

index 511ed37e783ed7196111cfbf8e7d10d78fb06374..d5d1a8b9c0354a24613b98169aa185690316a9ec 100644 (file)
@@ -167,7 +167,7 @@ static irqreturn_t acpi_als_trigger_handler(int irq, void *p)
        if (!pf->timestamp)
                pf->timestamp = iio_get_time_ns(indio_dev);
 
-       iio_push_to_buffers_with_timestamp(indio_dev, &scan, pf->timestamp);
+       iio_push_to_buffers_with_ts(indio_dev, &scan, sizeof(scan), pf->timestamp);
 out:
        mutex_unlock(&als->lock);
        iio_trigger_notify_done(indio_dev->trig);