Commit c4351b64 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron

iio: adc: ti-ads1100: fix error code in probe()

This code has a copy and paste bug so it accidentally returns
"PTR_ERR(data->reg_vdd)" which is a valid pointer cast to int. It
should return "ret" instead.

Fixes: 54188054 ("iio: adc: Add TI ADS1100 and ADS1000")
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/36fa2aeb-f392-4793-8b38-ae15514033c8@kili.mountainSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 46e33707
...@@ -344,7 +344,7 @@ static int ads1100_probe(struct i2c_client *client) ...@@ -344,7 +344,7 @@ static int ads1100_probe(struct i2c_client *client)
ret = regulator_enable(data->reg_vdd); ret = regulator_enable(data->reg_vdd);
if (ret < 0) if (ret < 0)
return dev_err_probe(dev, PTR_ERR(data->reg_vdd), return dev_err_probe(dev, ret,
"Failed to enable vdd regulator\n"); "Failed to enable vdd regulator\n");
ret = devm_add_action_or_reset(dev, ads1100_reg_disable, data->reg_vdd); ret = devm_add_action_or_reset(dev, ads1100_reg_disable, data->reg_vdd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment