[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64ca6d41-8173-4e0e-9467-4fa32db812ec@kernel.org>
Date: Wed, 17 Apr 2024 15:15:21 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Paul Geurts <paul_geurts@...e.nl>, mgreer@...malcreek.com,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] NFC: trf7970a: disable all regulators on removal
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@...e.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
Powered by blists - more mailing lists