diff options
| author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2025-08-02 17:44:34 +0100 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2025-08-16 15:57:51 +0100 |
| commit | 19487b50ac7f26c0287d65bb697a4a3aca616d9b (patch) | |
| tree | bad0cddd171e4f574cc0f83dcfe20c94f891218e /drivers/iio/light | |
| parent | 66c556aa8358cd71979da9738a810e6074918daa (diff) | |
iio: light: vcnl4000: Use a structure to make buffer arrangement explicit.
Removes the need for comments to describe the buffer passed to
iio_push_to_buffers_with_timestamp().
Reviewed-by: MÃ¥rten Lindahl <marten.lindahl@axis.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20250802164436.515988-15-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/light')
| -rw-r--r-- | drivers/iio/light/vcnl4000.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index 90e7d4421abf..eccf690eae8c 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -1662,7 +1662,10 @@ static irqreturn_t vcnl4010_trigger_handler(int irq, void *p) struct iio_dev *indio_dev = pf->indio_dev; struct vcnl4000_data *data = iio_priv(indio_dev); const unsigned long *active_scan_mask = indio_dev->active_scan_mask; - u16 buffer[8] __aligned(8) = {0}; /* 1x16-bit + naturally aligned ts */ + struct { + u16 chan; + aligned_s64 ts; + } scan = { }; bool data_read = false; unsigned long isr; int val = 0; @@ -1682,7 +1685,7 @@ static irqreturn_t vcnl4010_trigger_handler(int irq, void *p) if (ret < 0) goto end; - buffer[0] = val; + scan.chan = val; data_read = true; } } @@ -1695,7 +1698,7 @@ static irqreturn_t vcnl4010_trigger_handler(int irq, void *p) if (!data_read) goto end; - iio_push_to_buffers_with_timestamp(indio_dev, buffer, + iio_push_to_buffers_with_timestamp(indio_dev, &scan, iio_get_time_ns(indio_dev)); end: |
