From 253c3b24549b4e5648d1fc55dfb2d4a27cdf811b Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 29 Oct 2022 23:16:51 +0200
Subject: [PATCH 241/389] 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 e87567dbe99f..106ce7068fec 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -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]);
-- 
2.35.3

