Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7433cff authored by Linus Walleij's avatar Linus Walleij Committed by Liam Girdwood
Browse files

REGULATOR Handle positive returncode from enable



This makes _regulator_enable() properly handle the case where
a regulator is already on when you try to enable it. Currently
it will erroneously handle positive return values as an error.

Signed-off-by: default avatarLinus Walleij <linus.walleij@stericsson.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 9e108d33
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1236,11 +1236,12 @@ static int _regulator_enable(struct regulator_dev *rdev)
			} else {
				return -EINVAL;
			}
		} else {
		} else if (ret < 0) {
			printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n",
			       __func__, rdev->desc->name, ret);
			return ret;
		}
		/* Fallthrough on positive return values - already enabled */
	}

	rdev->use_count++;