X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fpower%2Fpmic%2Fpmic-uclass.c;h=64964e4e963ddb6291499f272d907331a88cc5c1;hb=b375d84135e26d5ec5034a515af4df5981785f37;hp=0f7fa517f9967c7dd48bde23c4dc1844cbc1da52;hpb=21342d4aed6c77a4aa7a5b2579b3c23e21aea31a;p=oweals%2Fu-boot.git diff --git a/drivers/power/pmic/pmic-uclass.c b/drivers/power/pmic/pmic-uclass.c index 0f7fa517f9..64964e4e96 100644 --- a/drivers/power/pmic/pmic-uclass.c +++ b/drivers/power/pmic/pmic-uclass.c @@ -19,29 +19,25 @@ DECLARE_GLOBAL_DATA_PTR; #if CONFIG_IS_ENABLED(PMIC_CHILDREN) -int pmic_bind_children(struct udevice *pmic, int offset, +int pmic_bind_children(struct udevice *pmic, ofnode parent, const struct pmic_child_info *child_info) { const struct pmic_child_info *info; - const void *blob = gd->fdt_blob; struct driver *drv; struct udevice *child; const char *node_name; int bind_count = 0; - int node; + ofnode node; int prefix_len; int ret; debug("%s for '%s' at node offset: %d\n", __func__, pmic->name, dev_of_offset(pmic)); - for (node = fdt_first_subnode(blob, offset); - node > 0; - node = fdt_next_subnode(blob, node)) { - node_name = fdt_get_name(blob, node, NULL); + ofnode_for_each_subnode(node, parent) { + node_name = ofnode_get_name(node); - debug("* Found child node: '%s' at offset:%d\n", node_name, - node); + debug("* Found child node: '%s'\n", node_name); child = NULL; for (info = child_info; info->prefix && info->driver; info++) { @@ -60,8 +56,8 @@ int pmic_bind_children(struct udevice *pmic, int offset, debug(" - found child driver: '%s'\n", drv->name); - ret = device_bind(pmic, drv, node_name, NULL, - node, &child); + ret = device_bind_with_driver_data(pmic, drv, node_name, + 0, node, &child); if (ret) { debug(" - child binding error: %d\n", ret); continue; @@ -82,7 +78,7 @@ int pmic_bind_children(struct udevice *pmic, int offset, debug(" - compatible prefix not found\n"); } - debug("Bound: %d childs for PMIC: '%s'\n", bind_count, pmic->name); + debug("Bound: %d children for PMIC: '%s'\n", bind_count, pmic->name); return bind_count; } #endif