提交 a7433cff 编写于 作者: L Linus Walleij 提交者: Liam Girdwood

REGULATOR Handle positive returncode from enable

This makes _regulator_enable() properly handle the case where
a regulator is already on when you try to enable it. Currently
it will erroneously handle positive return values as an error.
Signed-off-by: NLinus Walleij <linus.walleij@stericsson.com>
Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
上级 9e108d33
......@@ -1236,11 +1236,12 @@ static int _regulator_enable(struct regulator_dev *rdev)
} else {
return -EINVAL;
}
} else {
} else if (ret < 0) {
printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n",
__func__, rdev->desc->name, ret);
return ret;
}
/* Fallthrough on positive return values - already enabled */
}
rdev->use_count++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册