From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Antoni Pokusinski <apokusinski01@gmail.com>,
dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-iio@vger.kernel.org, linux@roeck-us.net,
rodrigo.gobbi.7@gmail.com, naresh.solanki@9elements.com,
michal.simek@amd.com, grantpeltier93@gmail.com,
farouk.bouabid@cherry.de, marcelo.schmitt1@gmail.com
Subject: Re: [PATCH 2/3] iio: mpl3115: add support for DRDY interrupt
Date: Sat, 27 Sep 2025 17:34:23 +0100 [thread overview]
Message-ID: <20250927173423.1eada3a5@jic23-huawei> (raw)
In-Reply-To: <CAHp75Vd8Bwk8HVc3DhG4L=SgbSh3aFTQ2VRn7Tri8YhJrqaXgw@mail.gmail.com>
> ...
>
> > 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;
> > + }
> > }
next prev parent reply other threads:[~2025-09-27 16:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-21 13:33 [PATCH 0/3] iio: mpl3115: add support for DRDY interrupt Antoni Pokusinski
2025-09-21 13:33 ` [PATCH 1/3] dt-bindings: iio: pressure: add binding for mpl3115 Antoni Pokusinski
2025-09-22 20:49 ` Rob Herring (Arm)
2025-09-25 3:40 ` Marcelo Schmitt
2025-09-21 13:33 ` [PATCH 2/3] iio: mpl3115: add support for DRDY interrupt Antoni Pokusinski
2025-09-21 19:29 ` Andy Shevchenko
2025-09-22 19:01 ` Antoni Pokusinski
2025-09-27 16:34 ` Jonathan Cameron [this message]
2025-09-22 9:15 ` Nuno Sá
2025-09-22 19:05 ` Antoni Pokusinski
2025-09-21 13:33 ` [PATCH 3/3] iio: mpl3115: add support for sampling frequency Antoni Pokusinski
2025-09-22 9:05 ` Nuno Sá
2025-09-22 21:19 ` David Lechner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250927173423.1eada3a5@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=apokusinski01@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=farouk.bouabid@cherry.de \
--cc=grantpeltier93@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=marcelo.schmitt1@gmail.com \
--cc=michal.simek@amd.com \
--cc=naresh.solanki@9elements.com \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
--cc=rodrigo.gobbi.7@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox