[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240712-iio-regulator-refactor-round-3-v1-1-835017bae43d@baylibre.com>
Date: Fri, 12 Jul 2024 11:03:52 -0500
From: David Lechner <dlechner@...libre.com>
To: Jonathan Cameron <jic23@...nel.org>,
Marius Cristea <marius.cristea@...rochip.com>,
Marcus Folkesson <marcus.folkesson@...il.com>,
Kent Gustavsson <kent@...oris.se>
Cc: David Lechner <dlechner@...libre.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/6] 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: David Lechner <dlechner@...libre.com>
---
drivers/iio/dac/mcp4728.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/iio/dac/mcp4728.c b/drivers/iio/dac/mcp4728.c
index c449ca949465..300985beb35d 100644
--- a/drivers/iio/dac/mcp4728.c
+++ b/drivers/iio/dac/mcp4728.c
@@ -540,7 +540,7 @@ static int mcp4728_probe(struct i2c_client *client)
const struct i2c_device_id *id = i2c_client_get_device_id(client);
struct mcp4728_data *data;
struct iio_dev *indio_dev;
- int err;
+ int ret;
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
if (!indio_dev)
@@ -554,14 +554,14 @@ static int mcp4728_probe(struct i2c_client *client)
if (IS_ERR(data->vdd_reg))
return PTR_ERR(data->vdd_reg);
- err = regulator_enable(data->vdd_reg);
- if (err)
- return err;
+ ret = regulator_enable(data->vdd_reg);
+ if (ret)
+ 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);
- if (err)
- return err;
+ if (ret)
+ return ret;
/*
* MCP4728 has internal EEPROM that save each channel boot
@@ -569,15 +569,15 @@ static int mcp4728_probe(struct i2c_client *client)
* driver at kernel boot. mcp4728_init_channels_data() reads back DAC
* settings and stores them in data structure.
*/
- err = mcp4728_init_channels_data(data);
- if (err) {
- return dev_err_probe(&client->dev, err,
+ ret = mcp4728_init_channels_data(data);
+ if (ret) {
+ return dev_err_probe(&client->dev, ret,
"failed to read mcp4728 current configuration\n");
}
- err = mcp4728_init_scales_avail(data);
- if (err) {
- return dev_err_probe(&client->dev, err,
+ ret = mcp4728_init_scales_avail(data);
+ if (ret) {
+ return dev_err_probe(&client->dev, ret,
"failed to init scales\n");
}
--
2.43.0
Powered by blists - more mailing lists