diff options
author | Axel Lin <axel.lin@gmail.com> | 2010-11-05 03:27:17 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-11-30 10:13:25 -0500 |
commit | 7727da22e820a96ab394db2fc0ab58f7f7ecb323 (patch) | |
tree | 4011058b68ad1ba9d39875a27b94ad7180566bee | |
parent | e36c1df8e18183ba2c691fe766a52c94020cdc5e (diff) |
regulator: Return proper error for regulator_register()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r-- | drivers/regulator/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 9da85bc21db4..711fa1722bce 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -2348,6 +2348,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | |||
2348 | if (init_data->supply_regulator && init_data->supply_regulator_dev) { | 2348 | if (init_data->supply_regulator && init_data->supply_regulator_dev) { |
2349 | dev_err(dev, | 2349 | dev_err(dev, |
2350 | "Supply regulator specified by both name and dev\n"); | 2350 | "Supply regulator specified by both name and dev\n"); |
2351 | ret = -EINVAL; | ||
2351 | goto scrub; | 2352 | goto scrub; |
2352 | } | 2353 | } |
2353 | 2354 | ||
@@ -2366,6 +2367,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | |||
2366 | if (!found) { | 2367 | if (!found) { |
2367 | dev_err(dev, "Failed to find supply %s\n", | 2368 | dev_err(dev, "Failed to find supply %s\n", |
2368 | init_data->supply_regulator); | 2369 | init_data->supply_regulator); |
2370 | ret = -ENODEV; | ||
2369 | goto scrub; | 2371 | goto scrub; |
2370 | } | 2372 | } |
2371 | 2373 | ||