From: Axel Lin Date: Fri, 5 Nov 2010 07:27:17 +0000 (+0800) Subject: regulator: Return proper error for regulator_register() X-Git-Tag: v3.0~2696^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7727da22e820a96ab394db2fc0ab58f7f7ecb323;p=platform%2Fkernel%2Flinux-amlogic.git regulator: Return proper error for regulator_register() Signed-off-by: Axel Lin Acked-by: Mark Brown Signed-off-by: Liam Girdwood --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 9da85bc..711fa17 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, if (init_data->supply_regulator && init_data->supply_regulator_dev) { dev_err(dev, "Supply regulator specified by both name and dev\n"); + ret = -EINVAL; goto scrub; } @@ -2366,6 +2367,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, if (!found) { dev_err(dev, "Failed to find supply %s\n", init_data->supply_regulator); + ret = -ENODEV; goto scrub; }