[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250927173423.1eada3a5@jic23-huawei>
Date: Sat, 27 Sep 2025 17:34:23 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Antoni Pokusinski <apokusinski01@...il.com>, dlechner@...libre.com,
nuno.sa@...log.com, andy@...nel.org, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-iio@...r.kernel.org, linux@...ck-us.net,
rodrigo.gobbi.7@...il.com, naresh.solanki@...ements.com,
michal.simek@....com, grantpeltier93@...il.com, farouk.bouabid@...rry.de,
marcelo.schmitt1@...il.com
Subject: Re: [PATCH 2/3] iio: mpl3115: add support for DRDY interrupt
> ...
>
> > 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;
> > + }
> > }
Powered by blists - more mailing lists