[PATCH] dm: pmic: ignore disabled node in pmic_bind_children

Patrick Delaunay patrick.delaunay at foss.st.com
Wed Oct 26 15:05:10 CEST 2022


Ignore the disabled children node in pmic_bind_children() so the
disabled regulators in device tree are not registered.

This patch is based on the dm_scan_fdt_node() code - only the
activated nodes are bound -  and it solves possible issue when a
deactivated regulator is bound, error for duplicated regulator name
for example.

Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
---
This patch solves the errors for duplicated regulator names on STM32MP15x
boards since the alignment with Linux device tree with the commit
9157a4ce36b18 ("ARM: dts: stm32: update SCMI dedicated file").

When SCMI is activated in "<board>-scmi.dts" device tree, the 3 regulators
reg11, reg18, usb33 are duplicated (children of scmi_reguls and of
pwr_regulators) even if the children of pwr_regulators are deactivated in
the file arch/arm/dts/stm32mp15-scmi.dtsi.

 drivers/power/pmic/pmic-uclass.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/power/pmic/pmic-uclass.c b/drivers/power/pmic/pmic-uclass.c
index 5dcf6d8079d2..0e2f5e1f4111 100644
--- a/drivers/power/pmic/pmic-uclass.c
+++ b/drivers/power/pmic/pmic-uclass.c
@@ -39,6 +39,10 @@ int pmic_bind_children(struct udevice *pmic, ofnode parent,
 		node_name = ofnode_get_name(node);
 
 		debug("* Found child node: '%s'\n", node_name);
+		if (!ofnode_is_enabled(node)) {
+			debug("  - ignoring disabled device\n");
+			continue;
+		}
 
 		child = NULL;
 		for (info = child_info; info->prefix && info->driver; info++) {
-- 
2.25.1



More information about the U-Boot mailing list