Re: [PATCH v2 2/5] iio: light: tcs3472: convert remaining locking to guard(mutex)
Andy Shevchenko <[email protected]>
| Newsgroups | dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel |
|---|---|
| Organization | Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo |
| Message-ID | <[email protected]> |
On Wed, May 13, 2026 at 12:32:12AM +0200, Aldo Conte wrote: > Convert the locking in tcs3472_read_event(), tcs3472_write_event(), > tcs3472_read_event_config(), tcs3472_write_event_config(), > tcs3472_powerdown() and tcs3472_resume() to use guard(mutex) > instead of explicit mutex_lock()/mutex_unlock() pairs. > > This avoids manual unlock calls on each return path, drops the goto > in tcs3472_write_event(), and removes 'ret' variables only needed to > return after the unlock. > > No functional change. ... > Suggested-by: Andy Shevchenko <[email protected]> Not appropriate tag, I suggested only changes (as you pointed out below) to your idea and initial contribution. > --- > v2: > (Suggested by Andy) > - Moved earlier in the series to avoid introducing manual locking in the devm > patch that would then be converted here. > - Dropped "found by code inspection" (this is a cleanup, not a bug) > - Test details moved to cover letter ... Code wise LGTM. -- With Best Regards, Andy Shevchenko