From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Neel Bullywon <neelb2403@gmail.com>,
dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8] iio: magnetometer: bmc150_magn: use automated cleanup for mutex
Date: Mon, 2 Mar 2026 21:15:43 +0000 [thread overview]
Message-ID: <20260302211543.28efc28b@jic23-huawei> (raw)
In-Reply-To: <aaVId0_InmrZJCl5@ashevche-desk.local>
On Mon, 2 Mar 2026 10:21:11 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Sun, Mar 01, 2026 at 11:56:33AM +0000, Jonathan Cameron wrote:
> > On Sat, 28 Feb 2026 12:23:20 -0500
> > Neel Bullywon <neelb2403@gmail.com> wrote:
> >
> > > Use guard() and scoped_guard() to replace manual mutex lock/unlock
> > > calls. This simplifies error handling and ensures RAII-style cleanup.
> > >
> > > guard() is used in read_raw, write_raw, trig_reen, and
> > > trigger_set_state. Case blocks using guard() in read_raw and write_raw
> > > are wrapped in braces at the case label level to ensure clear scope for
> > > the cleanup guards.
> > >
> > > A bmc150_magn_set_power_mode_locked() helper is added to deduplicate
> > > the lock-call-unlock pattern used by remove, runtime_suspend, suspend,
> > > and resume.
> > >
> > > The trigger_handler function is left unchanged as mixing guard() with
> > > goto error paths can be fragile.
> > >
> > > Signed-off-by: Neel Bullywon <neelb2403@gmail.com>
> > Hi Neel
> >
> > LGTM, but I'll leave some time for Andy to take another look if he
> > wants to.
>
> I briefly looked and I'm fine with the code, but I haven't reviewed it fully,
> hence
>
> Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
>
Applied. Thanks
J
prev parent reply other threads:[~2026-03-02 21:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-28 17:23 [PATCH v8] iio: magnetometer: bmc150_magn: use automated cleanup for mutex Neel Bullywon
2026-03-01 11:56 ` Jonathan Cameron
2026-03-02 8:21 ` Andy Shevchenko
2026-03-02 21:15 ` Jonathan Cameron [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=20260302211543.28efc28b@jic23-huawei \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neelb2403@gmail.com \
--cc=nuno.sa@analog.com \
/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