Skip to content

Commit 55b40d3

Browse files
groeckjic23
authored andcommitted
iio: max1363: Use devm_regulator_get_optional for optional regulator
In kernel version 3.13, devm_regulator_get() may return no error if a regulator is undeclared. regulator_get_voltage() will return -EINVAL if this happens. This causes the driver to fail loading if the vref regulator is not declared. Since vref is optional, call devm_regulator_get_optional instead. Signed-off-by: Guenter Roeck <[email protected]> Cc: [email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 5585215 commit 55b40d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/max1363.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ static int max1363_probe(struct i2c_client *client,
15601560
st->client = client;
15611561

15621562
st->vref_uv = st->chip_info->int_vref_mv * 1000;
1563-
vref = devm_regulator_get(&client->dev, "vref");
1563+
vref = devm_regulator_get_optional(&client->dev, "vref");
15641564
if (!IS_ERR(vref)) {
15651565
int vref_uv;
15661566

0 commit comments

Comments
 (0)