diff options
author | Simon Glass | 2020-11-28 17:50:03 -0700 |
---|---|---|
committer | Simon Glass | 2020-12-13 07:58:18 -0700 |
commit | a2703ce10cfcbe6a82ec8ed9ec10df2aeea08e64 (patch) | |
tree | 3b1e2e1d33b9e0bc9120be2cee4c6ca966876857 /drivers/clk/at91 | |
parent | 0de1b07406d709c3951dbb1a69ca196d80bd516d (diff) |
dm: Remove uses of device_bind_offset()
This function is not needed since the standard device_bind() can be used
instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/clk/at91')
-rw-r--r-- | drivers/clk/at91/compat.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/clk/at91/compat.c b/drivers/clk/at91/compat.c index 9563285674b..afd67b290d8 100644 --- a/drivers/clk/at91/compat.c +++ b/drivers/clk/at91/compat.c @@ -62,34 +62,30 @@ static int at91_pmc_core_probe(struct udevice *dev) */ int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name) { - const void *fdt = gd->fdt_blob; - int offset = dev_of_offset(dev); + ofnode parent = dev_ofnode(dev); + ofnode node; bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC); const char *name; int ret; - for (offset = fdt_first_subnode(fdt, offset); - offset > 0; - offset = fdt_next_subnode(fdt, offset)) { - if (pre_reloc_only && - !ofnode_pre_reloc(offset_to_ofnode(offset))) + ofnode_for_each_subnode(node, parent) { + if (pre_reloc_only && !ofnode_pre_reloc(node)) continue; /* * If this node has "compatible" property, this is not * a clock sub-node, but a normal device. skip. */ - fdt_get_property(fdt, offset, "compatible", &ret); - if (ret >= 0) + if (ofnode_read_prop(node, "compatible", NULL)) continue; if (ret != -FDT_ERR_NOTFOUND) return ret; - name = fdt_get_name(fdt, offset, NULL); + name = ofnode_get_name(node); if (!name) return -EINVAL; - ret = device_bind_driver_to_node(dev, drv_name, name, - offset_to_ofnode(offset), NULL); + ret = device_bind_driver_to_node(dev, drv_name, name, node, + NULL); if (ret) return ret; } |