[patch 2.6.30-rc3] regulator: regression fix

From: David Brownell
Date: Mon Apr 27 2009 - 23:00:00 EST


Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>

Revert the "Don't warn on omitted voltage constraints" patch
(3e2b9abda554e9f6105996dca77cca9ef98de17a), which doesn't do
quite what its comments said it was doing.

By removing the "else", it breaks the handling of fixed-voltage
regulators ... turning a non-error/non-warning situation into
a complete init failure, which can then prevent system startup.

Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
---
You might want to provide a different patch, but ignoring
this regression doesn't seem practical...

drivers/regulator/core.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -709,12 +709,8 @@ static int set_machine_constraints(struc
cmax = INT_MAX;
}

- /* voltage constraints are optional */
- if ((cmin == 0) && (cmax == 0))
- goto out;
-
/* else require explicit machine-level constraints */
- if (cmin <= 0 || cmax <= 0 || cmax < cmin) {
+ else if (cmin <= 0 || cmax <= 0 || cmax < cmin) {
pr_err("%s: %s '%s' voltage constraints\n",
__func__, "invalid", name);
ret = -EINVAL;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/