summaryrefslogtreecommitdiff
path: root/drivers/core/lists.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-05-18 20:09:06 -0600
committerSimon Glass <sjg@chromium.org>2017-06-01 07:03:08 -0600
commitf5b5719cdf13f3ee1ae949a3bcffafb6431eead4 (patch)
treea982505c95e565ecd4ad5b1f73a18d2715135c25 /drivers/core/lists.c
parent396e343b3d03e3773edf4a39f49c7918d4b8ff91 (diff)
dm: core: Update lists_bind_fdt() to use ofnode
Adjust this function to use an ofnode instead of an offset, so it can be used with livetree. This involves updating all callers. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/lists.c')
-rw-r--r--drivers/core/lists.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 9adfa758bc..facf276474 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -126,8 +126,7 @@ static int driver_check_compatible(const struct udevice_id *of_match,
return -ENOENT;
}
-int lists_bind_fdt(struct udevice *parent, const void *blob, int offset,
- struct udevice **devp)
+int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp)
{
struct driver *driver = ll_entry_start(struct driver, driver);
const int n_ents = ll_entry_count(struct driver, driver);
@@ -142,17 +141,18 @@ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset,
if (devp)
*devp = NULL;
- name = fdt_get_name(blob, offset, NULL);
+ name = ofnode_get_name(node);
dm_dbg("bind node %s\n", name);
- compat_list = fdt_getprop(blob, offset, "compatible", &compat_length);
+ compat_list = (const char *)ofnode_read_prop(node, "compatible",
+ &compat_length);
if (!compat_list) {
if (compat_length == -FDT_ERR_NOTFOUND) {
dm_dbg("Device '%s' has no compatible string\n", name);
return 0;
}
- dm_warn("Device tree error at offset %d\n", offset);
+ dm_warn("Device tree error at node '%s'\n", name);
return compat_length;
}
@@ -177,7 +177,7 @@ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset,
dm_dbg(" - found match at '%s'\n", entry->name);
ret = device_bind_with_driver_data(parent, entry, name,
- id->data, offset_to_ofnode(offset), &dev);
+ id->data, node, &dev);
if (ret == -ENODEV) {
dm_dbg("Driver '%s' refuses to bind\n", entry->name);
continue;