Re: [PATCH v2 4/4] iio: magnetometer: rm3100: Use guard(mutex)() in rm3100_trigger_handler()

Jonathan Cameron
2026-04-28T17:39:44Z

On Tue, 28 Apr 2026 12:27:18 -0500
Maxwell Doose <m32285159@gmail.com> wrote:

> On Tue, Apr 28, 2026 at 10:32 AM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> [snip]
> >
> > There is even an outside chance of deadlock if you hold a local lock
> > when calling iio_trigger_notify_done() as that can call back into the driver.
> > Here you are ok because no trigger_ops are set so there isn't a reenable()
> > callback.
> >
>
> Given this, I'll also likely go back to scoped_guard as well once we
> remove the gotos, that way we'll be able to unlock it before we get to
> a potential callback.
>
I'd prefer a helper function with straight forward guard() + returns.
Then you can have a single exit point from the outer function.

ret = helper()
if (ret)
return ret;

other stuff.

> best regards,
> maxwell