提交 da0607c8 编写于 作者: M Markus Pargmann 提交者: Mark Brown

regulator: anatop: Fail on invalid voltage selector

A '0' voltage selector is invalid and can't be used with this driver.
Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 fe08be3e
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册