From 70f31eb22b628cb1c0d62cf181b6226a8831837b Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 29 Oct 2022 23:16:51 +0200
Subject: [PATCH 301/463] 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>
---
 drivers/opp/core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 494f8860220d9..8b7159dea23d1 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -2185,6 +2185,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]);
-- 
2.46.0

