提交 32c78de8 编写于 作者: A Axel Lin 提交者: Mark Brown

regulator: Fix checking return value of create_regulator

create_regulator() returns NULL on fail.
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 bcda4321
......@@ -985,9 +985,8 @@ static int set_supply(struct regulator_dev *rdev,
rdev_info(rdev, "supplied by %s\n", rdev_get_name(supply_rdev));
rdev->supply = create_regulator(supply_rdev, &rdev->dev, "SUPPLY");
if (IS_ERR(rdev->supply)) {
err = PTR_ERR(rdev->supply);
rdev->supply = NULL;
if (rdev->supply == NULL) {
err = -ENOMEM;
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册