diff options
author | Luca Weiss <luca.weiss@fairphone.com> | 2022-06-14 13:20:50 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-06-18 17:55:17 +0100 |
commit | 82c89365733e28f39ef4a4d479c124f9f1e63671 (patch) | |
tree | 68617113b170d192832003442ef6e457b05067c4 /drivers/iio/proximity | |
parent | 0b685f435769bec6fe766da3c911a51b3afa9993 (diff) | |
download | linux-82c89365733e28f39ef4a4d479c124f9f1e63671.tar.bz2 |
proximity: vl53l0x: Make VDD regulator actually optional
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>
Link: https://lore.kernel.org/r/20220614112049.302278-1-luca.weiss@fairphone.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/proximity')
-rw-r--r-- | drivers/iio/proximity/vl53l0x-i2c.c | 2 |
1 files changed, 1 insertions, 1 deletions
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"); |