Thread (8 messages) 8 messages, 3 authors, 2014-02-25

[PATCH v3 0/2] regulator: core: Fix ops->enable/disable usage

From: broonie@kernel.org (Mark Brown)
Date: 2014-02-25 01:34:40
Also in: lkml
Subsystem: the rest, voltage and current regulator framework · Maintainers: Linus Torvalds, Liam Girdwood, Mark Brown

On Mon, Feb 24, 2014 at 09:50:58PM +0100, Markus Pargmann wrote:
The only situation where this returns -EINVAL is a dummy regulator that
is not always_on. As it doesn't make sense to have a dummy regulator
that is not always_on, I will add a check for exactly this situation to
the regulator_register function and drop the "return -EINVAL" above.
I've squashed the following fix in today:
From 937635aa9c667b90b76505de91c5693da6a5c120 Mon Sep 17 00:00:00 2001
From: Mark Brown <redacted>
Date: Tue, 25 Feb 2014 10:24:55 +0900
Subject: [PATCH] regulator: Handle invalid enable operation for always/boot on
 regulators

Signed-off-by: Mark Brown <redacted>
---
 drivers/regulator/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 8cbc7d7..9a09f3c 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1017,7 +1017,7 @@ static int set_machine_constraints(struct regulator_dev *rdev,
 	 */
 	if (rdev->constraints->always_on || rdev->constraints->boot_on) {
 		ret = _regulator_do_enable(rdev);
-		if (ret < 0) {
+		if (ret < 0 && ret != -EINVAL) {
 			rdev_err(rdev, "failed to enable\n");
 			goto out;
 		}
-- 
1.9.0.rc3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140225/08164a1a/attachment.sig>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help