Devicetree
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: light: veml3328: add support for new device
Date: Mon, 18 May 2026 09:44:21 +0300	[thread overview]
Message-ID: <agq1RVf-x4UnCOMI@ashevche-desk.local> (raw)
In-Reply-To: <CALoEA-zpJ2B4W6N-++cBqE6fBLsd08D4j+Rozgpt+1=NBAga0g@mail.gmail.com>

On Sun, May 17, 2026 at 07:11:06PM +0200, Joshua Crofts wrote:
> On Sun, 17 May 2026 at 15:34, Jonathan Cameron <jic23@kernel.org> 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



      reply	other threads:[~2026-05-18  6:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-16 21:50 [PATCH 0/2] iio: light: veml3328: add support for new sensor Joshua Crofts
2026-05-16 21:50 ` [PATCH 1/2] iio: light: veml3328: add devicetree binding " Joshua Crofts
2026-05-17  8:38   ` Krzysztof Kozlowski
2026-05-17 10:38     ` Joshua Crofts
2026-05-17 13:08       ` Jonathan Cameron
2026-05-17 13:10   ` Jonathan Cameron
2026-05-17 14:26     ` Joshua Crofts
2026-05-18 14:18       ` Joshua Crofts
2026-05-18 15:26         ` Jonathan Cameron
2026-05-16 21:50 ` [PATCH 2/2] iio: light: veml3328: add support for new device Joshua Crofts
2026-05-16 22:18   ` sashiko-bot
2026-05-16 22:30   ` Joshua Crofts
2026-05-17  7:53   ` Andy Shevchenko
2026-05-17 11:39     ` Joshua Crofts
2026-05-17 13:34   ` Jonathan Cameron
2026-05-17 14:21     ` Joshua Crofts
2026-05-17 15:55       ` Jonathan Cameron
2026-05-17 17:11     ` Joshua Crofts
2026-05-18  6:44       ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=agq1RVf-x4UnCOMI@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=joshua.crofts1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox