Re: [PATCH v4 5/5] iio: imu: inv_icm42600: use guard() to release mutexes
From: Andy Shevchenko
Date: Tue Sep 09 2025 - 07:39:35 EST
On Tue, Sep 09, 2025 at 09:11:11AM +0200, Sean Nyekjaer wrote:
> Replace explicit mutex_lock() and mutex_unlock() with the guard() macro
> for cleaner and safer mutex handling.
...
> /* exit if FIFO is already on */
> if (st->fifo.on) {
> - ret = 0;
> - goto out_on;
Probably you wanted the same comment here
/* increase FIFO on counter */
> + st->fifo.on++;
> + return 0;
> }
...
> /* exit if there are several sensors using the FIFO */
> if (st->fifo.on > 1) {
> - ret = 0;
> - goto out_off;
In the similar way
/* decrease FIFO on counter */
> + st->fifo.on--;
> + return 0;
> }
--
With Best Regards,
Andy Shevchenko