Re: [PATCH v6 3/6] iio: pressure: dps310: rework the raw read paths

From: Andy Shevchenko

Date: Tue Aug 25 2026 - 04:59:59 EST


On Mon, Aug 24, 2026 at 11:12:00PM +0300, Rupesh Majhi wrote:
> Raw reads take the lock themselves, so a processed pressure read takes it
> twice: once for the raw read, then again when
> dps310_calculate_pressure() trylocks to refresh temperature. Refresh is
> skipped whenever lock is busy.
>
> Split raw reads into variants that expect lock held, one helper per
> channel taking it once for the whole sequence. Temperature refresh is
> unconditional now. Buffered capture later in this series needs the same
> shape.

> Also use get_unaligned_be24() for 24-bit results, and mark functions that
> need the lock with __must_hold() rather than a comment.

The first part should be in a separate patch (24-bit value handling).

...

You also need cleanup.h for ACQUIRE().

> #include <linux/math64.h>
> #include <linux/module.h>
> #include <linux/regmap.h>
> +#include <linux/unaligned.h>

--
With Best Regards,
Andy Shevchenko