Commit ae405969 authored by David Lechner's avatar David Lechner Committed by Jonathan Cameron

iio: dac: mcp4728: rename err to ret in probe function

To prepare for using a function that returns a non-error value, rename
the variable 'err' to 'ret' in the probe function.
Signed-off-by: default avatarDavid Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240712-iio-regulator-refactor-round-3-v1-1-835017bae43d@baylibre.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 24867015
...@@ -540,7 +540,7 @@ static int mcp4728_probe(struct i2c_client *client) ...@@ -540,7 +540,7 @@ static int mcp4728_probe(struct i2c_client *client)
const struct i2c_device_id *id = i2c_client_get_device_id(client); const struct i2c_device_id *id = i2c_client_get_device_id(client);
struct mcp4728_data *data; struct mcp4728_data *data;
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
int err; int ret;
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
if (!indio_dev) if (!indio_dev)
...@@ -554,14 +554,14 @@ static int mcp4728_probe(struct i2c_client *client) ...@@ -554,14 +554,14 @@ static int mcp4728_probe(struct i2c_client *client)
if (IS_ERR(data->vdd_reg)) if (IS_ERR(data->vdd_reg))
return PTR_ERR(data->vdd_reg); return PTR_ERR(data->vdd_reg);
err = regulator_enable(data->vdd_reg); ret = regulator_enable(data->vdd_reg);
if (err) if (ret)
return err; return ret;
err = devm_add_action_or_reset(&client->dev, mcp4728_reg_disable, ret = devm_add_action_or_reset(&client->dev, mcp4728_reg_disable,
data->vdd_reg); data->vdd_reg);
if (err) if (ret)
return err; return ret;
/* /*
* MCP4728 has internal EEPROM that save each channel boot * MCP4728 has internal EEPROM that save each channel boot
...@@ -569,15 +569,15 @@ static int mcp4728_probe(struct i2c_client *client) ...@@ -569,15 +569,15 @@ static int mcp4728_probe(struct i2c_client *client)
* driver at kernel boot. mcp4728_init_channels_data() reads back DAC * driver at kernel boot. mcp4728_init_channels_data() reads back DAC
* settings and stores them in data structure. * settings and stores them in data structure.
*/ */
err = mcp4728_init_channels_data(data); ret = mcp4728_init_channels_data(data);
if (err) { if (ret) {
return dev_err_probe(&client->dev, err, return dev_err_probe(&client->dev, ret,
"failed to read mcp4728 current configuration\n"); "failed to read mcp4728 current configuration\n");
} }
err = mcp4728_init_scales_avail(data); ret = mcp4728_init_scales_avail(data);
if (err) { if (ret) {
return dev_err_probe(&client->dev, err, return dev_err_probe(&client->dev, ret,
"failed to init scales\n"); "failed to init scales\n");
} }
......
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