opp: core: Avoid confusing error when no regulator is defined in DT

A64 GPU doesn't have a separate regulator. Avoid useless error.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
This commit is contained in:
Ondrej Jirman 2022-10-29 23:16:51 +02:00 committed by orangepi-xunlong
parent 569dd76f92
commit 541451e333

View File

@ -2095,6 +2095,11 @@ static int _opp_set_regulators(struct opp_table *opp_table, struct device *dev,
for (i = 0; i < count; i++) {
reg = regulator_get_optional(dev, names[i]);
if (IS_ERR(reg)) {
if (PTR_ERR(reg) == -ENODEV) {
ret = -ENODEV;
goto free_regulators;
}
ret = dev_err_probe(dev, PTR_ERR(reg),
"%s: no regulator (%s) found\n",
__func__, names[i]);