提交 5b307627 编写于 作者: M Mark Brown 提交者: Liam Girdwood

regulator: Report error codes for bulk operations

If we're going to log an error we may as well log what the error
code that we're failing on is.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
上级 be0e2d3e
......@@ -1885,9 +1885,9 @@ int regulator_bulk_get(struct device *dev, int num_consumers,
consumers[i].consumer = regulator_get(dev,
consumers[i].supply);
if (IS_ERR(consumers[i].consumer)) {
dev_err(dev, "Failed to get supply '%s'\n",
consumers[i].supply);
ret = PTR_ERR(consumers[i].consumer);
dev_err(dev, "Failed to get supply '%s': %d\n",
consumers[i].supply, ret);
consumers[i].consumer = NULL;
goto err;
}
......@@ -1930,7 +1930,7 @@ int regulator_bulk_enable(int num_consumers,
return 0;
err:
printk(KERN_ERR "Failed to enable %s\n", consumers[i].supply);
printk(KERN_ERR "Failed to enable %s: %d\n", consumers[i].supply, ret);
for (i = 0; i < num_consumers; i++)
regulator_disable(consumers[i].consumer);
......@@ -1965,7 +1965,8 @@ int regulator_bulk_disable(int num_consumers,
return 0;
err:
printk(KERN_ERR "Failed to disable %s\n", consumers[i].supply);
printk(KERN_ERR "Failed to disable %s: %d\n", consumers[i].supply,
ret);
for (i = 0; i < num_consumers; i++)
regulator_enable(consumers[i].consumer);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册