diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-10-13 08:06:49 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2009-12-17 05:27:23 -0500 |
commit | 5b307627738f1f6cbc31fad9e28a299b5fe55602 (patch) | |
tree | 7fdf056fcf0079b12b0ae04c4c17a0b4ff9ceab6 /drivers | |
parent | be0e2d3e802908e2a3ca620ba8f49ecab87982b2 (diff) |
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: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/core.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index efe568deda1..9b43dab1638 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -1885,9 +1885,9 @@ int regulator_bulk_get(struct device *dev, int num_consumers, | |||
1885 | consumers[i].consumer = regulator_get(dev, | 1885 | consumers[i].consumer = regulator_get(dev, |
1886 | consumers[i].supply); | 1886 | consumers[i].supply); |
1887 | if (IS_ERR(consumers[i].consumer)) { | 1887 | if (IS_ERR(consumers[i].consumer)) { |
1888 | dev_err(dev, "Failed to get supply '%s'\n", | ||
1889 | consumers[i].supply); | ||
1890 | ret = PTR_ERR(consumers[i].consumer); | 1888 | ret = PTR_ERR(consumers[i].consumer); |
1889 | dev_err(dev, "Failed to get supply '%s': %d\n", | ||
1890 | consumers[i].supply, ret); | ||
1891 | consumers[i].consumer = NULL; | 1891 | consumers[i].consumer = NULL; |
1892 | goto err; | 1892 | goto err; |
1893 | } | 1893 | } |
@@ -1930,7 +1930,7 @@ int regulator_bulk_enable(int num_consumers, | |||
1930 | return 0; | 1930 | return 0; |
1931 | 1931 | ||
1932 | err: | 1932 | err: |
1933 | printk(KERN_ERR "Failed to enable %s\n", consumers[i].supply); | 1933 | printk(KERN_ERR "Failed to enable %s: %d\n", consumers[i].supply, ret); |
1934 | for (i = 0; i < num_consumers; i++) | 1934 | for (i = 0; i < num_consumers; i++) |
1935 | regulator_disable(consumers[i].consumer); | 1935 | regulator_disable(consumers[i].consumer); |
1936 | 1936 | ||
@@ -1965,7 +1965,8 @@ int regulator_bulk_disable(int num_consumers, | |||
1965 | return 0; | 1965 | return 0; |
1966 | 1966 | ||
1967 | err: | 1967 | err: |
1968 | printk(KERN_ERR "Failed to disable %s\n", consumers[i].supply); | 1968 | printk(KERN_ERR "Failed to disable %s: %d\n", consumers[i].supply, |
1969 | ret); | ||
1969 | for (i = 0; i < num_consumers; i++) | 1970 | for (i = 0; i < num_consumers; i++) |
1970 | regulator_enable(consumers[i].consumer); | 1971 | regulator_enable(consumers[i].consumer); |
1971 | 1972 | ||