summaryrefslogtreecommitdiffstats
path: root/drivers/iio/pressure/bmp280-core.c
diff options
context:
space:
mode:
authorWei Yongjun2016-07-14 13:06:11 +0200
committerJonathan Cameron2016-08-15 16:38:59 +0200
commitbb9947c3a14e781eb0f137728e7e55ec8d848991 (patch)
treede848c17a63419122e8b09e3cdd4c6bb71b7522d /drivers/iio/pressure/bmp280-core.c
parentLinux 4.8-rc2 (diff)
downloadkernel-qcow2-linux-bb9947c3a14e781eb0f137728e7e55ec8d848991.tar.gz
kernel-qcow2-linux-bb9947c3a14e781eb0f137728e7e55ec8d848991.tar.xz
kernel-qcow2-linux-bb9947c3a14e781eb0f137728e7e55ec8d848991.zip
iio: pressure: bmp280: fix wrong pointer passed to PTR_ERR()
PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/pressure/bmp280-core.c')
-rw-r--r--drivers/iio/pressure/bmp280-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index 6943688e66df..94e27b2600f3 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -970,7 +970,7 @@ int bmp280_common_probe(struct device *dev,
data->vdda = devm_regulator_get(dev, "vdda");
if (IS_ERR(data->vdda)) {
dev_err(dev, "failed to get VDDA regulator\n");
- ret = PTR_ERR(data->vddd);
+ ret = PTR_ERR(data->vdda);
goto out_disable_vddd;
}
ret = regulator_enable(data->vdda);