On Sat, 2024-03-16 at 21:39 +0200, Andy Shevchenko wrote: > Thu, Feb 29, 2024 at 04:10:26PM +0100, Nuno Sa kirjoitti: > > Use the new cleanup magic for handling mutexes in IIO. This allows us to > > greatly simplify some code paths. > > ... > > > static void iio_trigger_put_irq(struct iio_trigger *trig, int irq) > > { > > - mutex_lock(&trig->pool_lock); > > + guard(mutex)(&trig->pool_lock); > > clear_bit(irq - trig->subirq_base, trig->pool); > > Another side note: Why do we need atomic bit operation(s)? > Did not checked the code but my guess is that the lock is always grabbed so we likely don't need the atomic variants. But that's something for a future patch. - Nuno Sá