From: Patrick Delaunay Date: Wed, 26 Oct 2022 13:05:10 +0000 (+0200) Subject: dm: pmic: ignore disabled node in pmic_bind_children X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=30257f4699e0e58818f6e6f86021a994f485ee58;p=u-boot.git dm: pmic: ignore disabled node in pmic_bind_children 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 Reviewed-by: Simon Glass --- diff --git a/drivers/power/pmic/pmic-uclass.c b/drivers/power/pmic/pmic-uclass.c index 5dcf6d8079..0e2f5e1f41 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++) {