Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 668f777

Browse files
cris-mabroonie
authored andcommitted
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. Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Link: https://lore.kernel.org/r/20230126180511.766373-1-cristian.marussi@arm.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent d5b4c8b commit 668f777

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

drivers/regulator/scmi-regulator.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -311,16 +311,12 @@ static int scmi_regulator_probe(struct scmi_device *sdev)
311311
return PTR_ERR(voltage_ops);
312312

313313
num_doms = voltage_ops->num_domains_get(ph);
314-
if (num_doms <= 0) {
315-
if (!num_doms) {
316-
dev_err(&sdev->dev,
317-
"number of voltage domains invalid\n");
318-
num_doms = -EINVAL;
319-
} else {
320-
dev_err(&sdev->dev,
321-
"failed to get voltage domains - err:%d\n",
322-
num_doms);
323-
}
314+
if (!num_doms)
315+
return 0;
316+
317+
if (num_doms < 0) {
318+
dev_err(&sdev->dev, "failed to get voltage domains - err:%d\n",
319+
num_doms);
324320

325321
return num_doms;
326322
}

0 commit comments

Comments
 (0)