From: Guenter Roeck <linux@roeck-us.net>
To: Ciprian Costea <ciprianmarian.costea@oss.nxp.com>,
Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
NXP S32 Linux <s32@nxp.com>,
imx@lists.linux.dev, Christophe Lizzi <clizzi@redhat.com>,
Alberto Ruiz <aruizrui@redhat.com>,
Enric Balletbo <eballetb@redhat.com>,
Eric Chanudet <echanude@redhat.com>,
Florin Buica <florin.buica@nxp.com>
Subject: Re: [PATCH] hwmon: (ina2xx) make regulator 'vs' support optional
Date: Thu, 3 Apr 2025 05:15:03 -0700 [thread overview]
Message-ID: <dab2f459-240f-4e4c-9bf6-8c0285354cfb@roeck-us.net> (raw)
In-Reply-To: <20250403101516.3047802-1-ciprianmarian.costea@oss.nxp.com>
On 4/3/25 03:15, Ciprian Costea wrote:
> From: Ciprian Marian Costea <ciprianmarian.costea@oss.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@nxp.com>
> Signed-off-by: Florin Buica <florin.buica@nxp.com>
> Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea@oss.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);
next prev parent reply other threads:[~2025-04-03 12:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-03 10:15 [PATCH] hwmon: (ina2xx) make regulator 'vs' support optional Ciprian Costea
2025-04-03 12:15 ` Guenter Roeck [this message]
2025-04-03 14:29 ` Ciprian Marian Costea
2025-04-03 16:06 ` Guenter Roeck
2025-04-04 8:36 ` Ciprian Marian Costea
2025-04-08 18:07 ` Guenter Roeck
2025-04-09 7:03 ` Ciprian Marian Costea
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=dab2f459-240f-4e4c-9bf6-8c0285354cfb@roeck-us.net \
--to=linux@roeck-us.net \
--cc=aruizrui@redhat.com \
--cc=ciprianmarian.costea@oss.nxp.com \
--cc=clizzi@redhat.com \
--cc=eballetb@redhat.com \
--cc=echanude@redhat.com \
--cc=florin.buica@nxp.com \
--cc=imx@lists.linux.dev \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=s32@nxp.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