Skip to content

Commit

Permalink
iio: pressure: bmp280: fix wrong pointer passed to PTR_ERR()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Jonathan Cameron committed Aug 15, 2016
1 parent 694d0d0 commit bb9947c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/pressure/bmp280-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bb9947c

Please sign in to comment.