aboutsummaryrefslogtreecommitdiff
path: root/drivers/clk/at91
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/at91')
-rw-r--r--drivers/clk/at91/compat.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/clk/at91/compat.c b/drivers/clk/at91/compat.c
index ba288ca..b2bfb52 100644
--- a/drivers/clk/at91/compat.c
+++ b/drivers/clk/at91/compat.c
@@ -63,30 +63,34 @@ static int at91_pmc_core_probe(struct udevice *dev)
*/
int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name)
{
- ofnode parent = dev_ofnode(dev);
- ofnode node;
+ const void *fdt = gd->fdt_blob;
+ int offset = dev_of_offset(dev);
bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
const char *name;
int ret;
- ofnode_for_each_subnode(node, parent) {
- if (pre_reloc_only && !ofnode_pre_reloc(node))
+ 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)))
continue;
/*
* If this node has "compatible" property, this is not
* a clock sub-node, but a normal device. skip.
*/
- if (ofnode_read_prop(node, "compatible", NULL))
+ fdt_get_property(fdt, offset, "compatible", &ret);
+ if (ret >= 0)
continue;
if (ret != -FDT_ERR_NOTFOUND)
return ret;
- name = ofnode_get_name(node);
+ name = fdt_get_name(fdt, offset, NULL);
if (!name)
return -EINVAL;
- ret = device_bind_driver_to_node(dev, drv_name, name, node,
- NULL);
+ ret = device_bind_driver_to_node(dev, drv_name, name,
+ offset_to_ofnode(offset), NULL);
if (ret)
return ret;
}