[PATCH v5 3/5] power: zynqmp: Mask node already configured error

Stefan Herbrechtsmeier stefan.herbrechtsmeier-oss at weidmueller.com
Tue May 23 14:42:12 CEST 2023


From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>

Do not return an error (ENODEV) from the request function if the node is
already configured.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>

---

Changes in v5:
- Added

 drivers/power/domain/zynqmp-power-domain.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/power/domain/zynqmp-power-domain.c b/drivers/power/domain/zynqmp-power-domain.c
index adbbb5fdd9..5ee9e020fb 100644
--- a/drivers/power/domain/zynqmp-power-domain.c
+++ b/drivers/power/domain/zynqmp-power-domain.c
@@ -23,12 +23,17 @@ static int zynqmp_pm_request_node(const u32 node, const u32 capabilities,
 
 static int zynqmp_power_domain_request(struct power_domain *power_domain)
 {
+	int ret = 0;
+
 	dev_dbg(power_domain->dev, "Request for id: %ld\n", power_domain->id);
 
-	if (IS_ENABLED(CONFIG_ARCH_ZYNQMP))
-		return zynqmp_pmufw_node(power_domain->id);
+	if (IS_ENABLED(CONFIG_ARCH_ZYNQMP)) {
+		ret = zynqmp_pmufw_node(power_domain->id);
+		if (ret == -ENODEV)
+			ret = 0;
+	}
 
-	return 0;
+	return ret;
 }
 
 static int zynqmp_power_domain_free(struct power_domain *power_domain)
-- 
2.30.2



More information about the U-Boot mailing list