mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-23 03:38:12 +07:00
regulator: anatop: Fail on invalid voltage selector
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>
This commit is contained in:
parent
fe08be3ec8
commit
da0607c8df
@ -291,6 +291,11 @@ static int anatop_regulator_probe(struct platform_device *pdev)
|
|||||||
*/
|
*/
|
||||||
if (!sreg->sel && !strcmp(sreg->name, "vddpu"))
|
if (!sreg->sel && !strcmp(sreg->name, "vddpu"))
|
||||||
sreg->sel = 22;
|
sreg->sel = 22;
|
||||||
|
|
||||||
|
if (!sreg->sel) {
|
||||||
|
dev_err(&pdev->dev, "Failed to read a valid default voltage selector.\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
rdesc->ops = &anatop_rops;
|
rdesc->ops = &anatop_rops;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user