Re: [PATCH 2/2] iio: light: veml3328: add support for new device

From: Joshua Crofts

Date: Sun May 17 2026 - 13:11:27 EST


On Sun, 17 May 2026 at 15:34, Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> > +static int veml3328_write_raw(struct iio_dev *indio_dev,
> > + struct iio_chan_spec const *chan,
> > + int val, int val2, long mask)
> > +{
> > + struct veml3328_data *data = iio_priv(indio_dev);
> > + struct regmap *regmap = data->regmap;
> > + int ret;
> > + int i;
> > +
> > + guard(mutex)(&data->lock);
> > +
> > + ret = pm_runtime_resume_and_get(data->dev);
>
> PM_RUNTIME_ACQUIRE_AUTOSUSPEND() will mean you can rely on this
> being auto suspended on exiting scope. Will allow early returns
> and get rid of your goto that you noted already.

Sorry if this is a silly request, however I can't seem to understand how the
macro mentioned above works... Could someone point me to documentation
on it or a functioning example in a driver? I tried analyzing this
with AI as well
and it keeps going in circles that the macro does not exist :(

--
Kind regards

CJD