diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-06-20 20:22:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-06-21 11:35:30 +0100 |
commit | b70e19c222a64018d308ebc80333575aff9f4e51 (patch) | |
tree | 93665f41330e5e33a281bc4925b5b714885be9b1 | |
parent | 361d79500244cc734588534d2756e2495f1549a6 (diff) | |
download | talos-op-linux-b70e19c222a64018d308ebc80333575aff9f4e51.tar.gz talos-op-linux-b70e19c222a64018d308ebc80333575aff9f4e51.zip |
staging: iio/ad7291: fix error code in ad7291_probe()
We should be returning a negative error code instead of success here.
This would have been detected by GCC, except that the "ret" variable was
initialized with a bogus value to disable GCC's uninitialized variable
warnings. I've cleaned that up, as well.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Stable@vger.kernel.org
-rw-r--r-- | drivers/staging/iio/adc/ad7291.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/iio/adc/ad7291.c b/drivers/staging/iio/adc/ad7291.c index 357cef2a6f4c..7194bd138762 100644 --- a/drivers/staging/iio/adc/ad7291.c +++ b/drivers/staging/iio/adc/ad7291.c @@ -465,7 +465,7 @@ static int ad7291_probe(struct i2c_client *client, struct ad7291_platform_data *pdata = client->dev.platform_data; struct ad7291_chip_info *chip; struct iio_dev *indio_dev; - int ret = 0; + int ret; indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*chip)); if (!indio_dev) @@ -475,7 +475,7 @@ static int ad7291_probe(struct i2c_client *client, if (pdata && pdata->use_external_ref) { chip->reg = devm_regulator_get(&client->dev, "vref"); if (IS_ERR(chip->reg)) - return ret; + return PTR_ERR(chip->reg); ret = regulator_enable(chip->reg); if (ret) |