lkml.org 
[lkml]   [2024]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] NFC: trf7970a: disable all regulators on removal
From
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


\
 
 \ /
  Last update: 2024-04-17 15:15    [W:0.916 / U:1.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site