]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
regulator: Return proper error for regulator_register()
authorAxel Lin <axel.lin@gmail.com>
Fri, 5 Nov 2010 07:27:17 +0000 (15:27 +0800)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Tue, 30 Nov 2010 15:13:25 +0000 (15:13 +0000)
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>
drivers/regulator/core.c

index 9da85bc21db49f7ed8bcf388d3afce83fd4974d4..711fa1722bcea6aae685c2c1d2dc0c1bb8ba168e 100644 (file)
@@ -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;
                }