projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe08be3
)
regulator: anatop: Fail on invalid voltage selector
author
Markus Pargmann
<mpa@pengutronix.de>
Mon, 6 Oct 2014 19:33:37 +0000
(21:33 +0200)
committer
Mark Brown
<broonie@kernel.org>
Mon, 20 Oct 2014 11:23:41 +0000
(12:23 +0100)
A '0' voltage selector is invalid and can't be used with this driver.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/anatop-regulator.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/anatop-regulator.c
b/drivers/regulator/anatop-regulator.c
index
30e8d7a
..
542d14e
100644
(file)
--- a/
drivers/regulator/anatop-regulator.c
+++ b/
drivers/regulator/anatop-regulator.c
@@
-291,6
+291,11
@@
static int anatop_regulator_probe(struct platform_device *pdev)
*/
if (!sreg->sel && !strcmp(sreg->name, "vddpu"))
sreg->sel = 22;
+
+ if (!sreg->sel) {
+ dev_err(&pdev->dev, "Failed to read a valid default voltage selector.\n");
+ return -EINVAL;
+ }
} else {
rdesc->ops = &anatop_rops;
}