From: Krzysztof Kozlowski <krzk@kernel.org>
To: Paul Geurts <paul_geurts@live.nl>,
mgreer@animalcreek.com, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] NFC: trf7970a: disable all regulators on removal
Date: Wed, 17 Apr 2024 15:15:21 +0200 [thread overview]
Message-ID: <64ca6d41-8173-4e0e-9467-4fa32db812ec@kernel.org> (raw)
In-Reply-To: <AM0PR09MB2675EDFD44EC82B6BCBB430F95082@AM0PR09MB2675.eurprd09.prod.outlook.com>
On 16/04/2024 22:28, Paul Geurts wrote:
> During module probe, regulator 'vin' and 'vdd-io' are used and enabled,
> but the vdd-io regulator overwrites the 'vin' regulator pointer. During
> remove, only the vdd-io is disabled, as the vin regulator pointer is not
> available anymore. When regulator_put() is called during resource
> cleanup a kernel warning is given, as the regulator is still enabled.
>
> Store the two regulators in separate pointers and disable both the
> regulators on module remove.
>
> Fixes: 49d22c70aaf0 ("NFC: trf7970a: Add device tree option of 1.8 Volt IO voltage")
>
> Signed-off-by: Paul Geurts <paul_geurts@live.nl>
No blank lines between tags. Please look at existing commits (git log).
> ---
> drivers/nfc/trf7970a.c | 42 +++++++++++++++++++++++-------------------
> 1 file changed, 23 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
> index 7eb17f46a815..9e1a34e23af2 100644
> --- a/drivers/nfc/trf7970a.c
> +++ b/drivers/nfc/trf7970a.c
> @@ -424,7 +424,8 @@ struct trf7970a {
> enum trf7970a_state state;
> struct device *dev;
> struct spi_device *spi;
> - struct regulator *regulator;
> + struct regulator *vin_regulator;
> + struct regulator *vddio_regulator;
> struct nfc_digital_dev *ddev;
> u32 quirks;
> bool is_initiator;
> @@ -1883,7 +1884,7 @@ static int trf7970a_power_up(struct trf7970a *trf)
> if (trf->state != TRF7970A_ST_PWR_OFF)
> return 0;
>
> - ret = regulator_enable(trf->regulator);
> + ret = regulator_enable(trf->vin_regulator);
That does not look like equivalent code. Previously this was vddio, right?
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-04-17 13:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-16 20:28 [PATCH] NFC: trf7970a: disable all regulators on removal Paul Geurts
2024-04-17 13:15 ` Krzysztof Kozlowski [this message]
2024-04-18 8:12 ` Paul Geurts
2024-04-18 17:07 ` Krzysztof Kozlowski
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=64ca6d41-8173-4e0e-9467-4fa32db812ec@kernel.org \
--to=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mgreer@animalcreek.com \
--cc=netdev@vger.kernel.org \
--cc=paul_geurts@live.nl \
/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;
as well as URLs for NNTP newsgroup(s).