Re: [PATCH 2/3] iio: mpl3115: add support for DRDY interrupt
From: Jonathan Cameron
Date: Sat Sep 27 2025 - 12:34:35 EST
> ...
>
> > mutex_lock(&data->lock);
> > - ret = mpl3115_request(data);
> > - if (ret < 0) {
> > - mutex_unlock(&data->lock);
> > - goto done;
> > + if (!(data->ctrl_reg1 & MPL3115_CTRL_ACTIVE)) {
> > + ret = mpl3115_request(data);
> > + if (ret < 0) {
>
> > + mutex_unlock(&data->lock);
>
> Instead, I suggest adding a prerequisite that moves the driver to use
> cleanup.h, in particular scoped_guard(). This will reduce a churn
> here,
I'll comment on this in version 3, but I'm not sure scoped_guard() is
necessarily a good idea here.
Also note that there is no requirement to use one style universally in
a driver (guard / vs explicit unlocks) as often they work best in different
usecases with the same locks.
>
> > + goto done;
> > + }
> > }