[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dab2f459-240f-4e4c-9bf6-8c0285354cfb@roeck-us.net>
Date: Thu, 3 Apr 2025 05:15:03 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Ciprian Costea <ciprianmarian.costea@....nxp.com>,
Jean Delvare <jdelvare@...e.com>
Cc: linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
NXP S32 Linux <s32@....com>, imx@...ts.linux.dev,
Christophe Lizzi <clizzi@...hat.com>, Alberto Ruiz <aruizrui@...hat.com>,
Enric Balletbo <eballetb@...hat.com>, Eric Chanudet <echanude@...hat.com>,
Florin Buica <florin.buica@....com>
Subject: Re: [PATCH] hwmon: (ina2xx) make regulator 'vs' support optional
On 4/3/25 03:15, Ciprian Costea wrote:
> From: Ciprian Marian Costea <ciprianmarian.costea@....nxp.com>
>
> S32G2/S32G3 based boards which integrate the ina231 sensor do not have a
> dedicated voltage regulator.
>
> Co-developed-by: Florin Buica <florin.buica@....com>
> Signed-off-by: Florin Buica <florin.buica@....com>
> Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea@....nxp.com>
> ---
> drivers/hwmon/ina2xx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
> index 345fe7db9de9..ab4972f94a8c 100644
> --- a/drivers/hwmon/ina2xx.c
> +++ b/drivers/hwmon/ina2xx.c
> @@ -959,8 +959,8 @@ static int ina2xx_probe(struct i2c_client *client)
> return PTR_ERR(data->regmap);
> }
>
> - ret = (dev, "vs");
> - if (ret)
> + ret = devm_regulator_get_enable_optional(dev, "vs");
devm_regulator_get_enable() should provide a dummy regulator if there is
no explicit regulator. Why does this not work ?
> + if (ret < 0 && ret != -ENODEV)
Why this added check ?
I know it used to be necessary if regulator support is disabled,
but that is no longer the case.
Guenter
> return dev_err_probe(dev, ret, "failed to enable vs regulator\n");
>
> ret = ina2xx_init(dev, data);
Powered by blists - more mailing lists