Re: [PATCH 2/2] iio: light: veml3328: add support for new device
From: Andy Shevchenko
Date: Mon May 18 2026 - 02:45:07 EST
On Sun, May 17, 2026 at 07:11:06PM +0200, Joshua Crofts wrote:
> On Sun, 17 May 2026 at 15:34, Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
...
> > > + 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?
`git grep ...` is your everyday tool for most questions in the kernel :-)
In short it uses the guard()()-type approach beneath, it creates a scoped auto
variable on stack and then uses it at the function epilogue.
--
With Best Regards,
Andy Shevchenko