[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230126180511.766373-1-cristian.marussi@arm.com>
Date: Thu, 26 Jan 2023 18:05:11 +0000
From: Cristian Marussi <cristian.marussi@....com>
To: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: sudeep.holla@....com, Cristian Marussi <cristian.marussi@....com>,
Mark Brown <broonie@...nel.org>,
Jim Quinlan <james.quinlan@...adcom.com>,
Florian Fainelli <florian.fainelli@...adcom.com>
Subject: [PATCH] regulator: scmi: Allow for zero voltage domains
SCMI Voltage protocol allows the platform to report no voltage domains
on discovery, while warning the user about such an odd configuration.
As a consequence this condition should not be treated as error by the SCMI
regulator driver either.
Allow SCMI regulator driver to probe successfully even when no voltage
domains are discovered.
Cc: Mark Brown <broonie@...nel.org>
Cc: Jim Quinlan <james.quinlan@...adcom.com>
Cc: Florian Fainelli <florian.fainelli@...adcom.com>
Fixes: 0fbeae70ee7c ("regulator: add SCMI driver")
Signed-off-by: Cristian Marussi <cristian.marussi@....com>
---
drivers/regulator/scmi-regulator.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/regulator/scmi-regulator.c b/drivers/regulator/scmi-regulator.c
index b9918f4fd241..29ab217297d6 100644
--- a/drivers/regulator/scmi-regulator.c
+++ b/drivers/regulator/scmi-regulator.c
@@ -311,16 +311,12 @@ static int scmi_regulator_probe(struct scmi_device *sdev)
return PTR_ERR(voltage_ops);
num_doms = voltage_ops->num_domains_get(ph);
- if (num_doms <= 0) {
- if (!num_doms) {
- dev_err(&sdev->dev,
- "number of voltage domains invalid\n");
- num_doms = -EINVAL;
- } else {
- dev_err(&sdev->dev,
- "failed to get voltage domains - err:%d\n",
- num_doms);
- }
+ if (!num_doms)
+ return 0;
+
+ if (num_doms < 0) {
+ dev_err(&sdev->dev, "failed to get voltage domains - err:%d\n",
+ num_doms);
return num_doms;
}
--
2.34.1
Powered by blists - more mailing lists