From: Jonathan Cameron <jic23@kernel.org>
To: Luca Weiss <luca.weiss@fairphone.com>
Cc: linux-iio@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht,
phone-devel@vger.kernel.org,
Song Qiang <songqiang1304521@gmail.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Markuss Broks <markuss.broks@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proximity: vl53l0x: Make VDD regulator actually optional
Date: Sat, 18 Jun 2022 17:55:30 +0100 [thread overview]
Message-ID: <20220618175530.2106129e@jic23-huawei> (raw)
In-Reply-To: <20220614112049.302278-1-luca.weiss@fairphone.com>
On Tue, 14 Jun 2022 13:20:50 +0200
Luca Weiss <luca.weiss@fairphone.com> wrote:
> Contrary to what the naming might suggest, devm_regulator_get_optional
> returns -ENODEV in case the regulator is not found which will trigger
> probe error in this driver.
>
> Use devm_regulator_get instead which will return a dummy regulator that
> we can just use as if it was a proper regulator.
>
> Fixes: d3d6dba56dab ("proximity: vl53l0x: Handle the VDD regulator")
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
> @Jonathan: As discussed in the other email, maybe you want to
> adjust/remove the "Fixes:" tag. Your call.
Applied to the togreg branch of iio.git.
>
> drivers/iio/proximity/vl53l0x-i2c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/proximity/vl53l0x-i2c.c b/drivers/iio/proximity/vl53l0x-i2c.c
> index 3b7a33ff601d..c7c4d33d340f 100644
> --- a/drivers/iio/proximity/vl53l0x-i2c.c
> +++ b/drivers/iio/proximity/vl53l0x-i2c.c
> @@ -237,7 +237,7 @@ static int vl53l0x_probe(struct i2c_client *client)
> I2C_FUNC_SMBUS_BYTE_DATA))
> return -EOPNOTSUPP;
>
> - data->vdd_supply = devm_regulator_get_optional(&client->dev, "vdd");
> + data->vdd_supply = devm_regulator_get(&client->dev, "vdd");
> if (IS_ERR(data->vdd_supply))
> return dev_err_probe(&client->dev, PTR_ERR(data->vdd_supply),
> "Unable to get VDD regulator\n");
prev parent reply other threads:[~2022-06-18 16:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-14 11:20 [PATCH] proximity: vl53l0x: Make VDD regulator actually optional Luca Weiss
2022-06-18 16:55 ` Jonathan Cameron [this message]
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=20220618175530.2106129e@jic23-huawei \
--to=jic23@kernel.org \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.weiss@fairphone.com \
--cc=markuss.broks@gmail.com \
--cc=phone-devel@vger.kernel.org \
--cc=songqiang1304521@gmail.com \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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