summaryrefslogtreecommitdiffstats
path: root/drivers/core/lists.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-07-23 06:55:22 -0600
committerSimon Glass <sjg@chromium.org>2014-07-23 14:08:37 +0100
commit9b0ba067f96c2bbd4bcdf0128906877271eab548 (patch)
tree6860d1cd9ff2f3e600182a5af7eaab785cfddac7 /drivers/core/lists.c
parenta327dee0f40bcdebaba1a3e47f2b9f1ceb970d2a (diff)
downloadtalos-obmc-uboot-9b0ba067f96c2bbd4bcdf0128906877271eab548.tar.gz
talos-obmc-uboot-9b0ba067f96c2bbd4bcdf0128906877271eab548.zip
dm: Improve errors and warnings in lists_bind_fdt()
Add a debug message for when a device tree node has no driver. Also reword the warning when a device fails to bind, which was misleading. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/lists.c')
-rw-r--r--drivers/core/lists.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 5f1c85fd6e..0f08bfd6ff 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -124,16 +124,19 @@ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset)
const int n_ents = ll_entry_count(struct driver, driver);
struct driver *entry;
struct udevice *dev;
+ bool found = false;
const char *name;
int result = 0;
- int ret;
+ int ret = 0;
dm_dbg("bind node %s\n", fdt_get_name(blob, offset, NULL));
for (entry = driver; entry != driver + n_ents; entry++) {
ret = driver_check_compatible(blob, offset, entry->of_match);
+ name = fdt_get_name(blob, offset, NULL);
if (ret == -ENOENT) {
continue;
} else if (ret == -ENODEV) {
+ dm_dbg("Device '%s' has no compatible string\n", name);
break;
} else if (ret) {
dm_warn("Device tree error at offset %d\n", offset);
@@ -142,14 +145,21 @@ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset)
break;
}
- name = fdt_get_name(blob, offset, NULL);
dm_dbg(" - found match at '%s'\n", entry->name);
ret = device_bind(parent, entry, name, NULL, offset, &dev);
if (ret) {
- dm_warn("No match for driver '%s'\n", entry->name);
+ dm_warn("Error binding driver '%s'\n", entry->name);
if (!result || ret != -ENOENT)
result = ret;
+ } else {
+ found = true;
}
+ break;
+ }
+
+ if (!found && !result && ret != -ENODEV) {
+ dm_dbg("No match for node '%s'\n",
+ fdt_get_name(blob, offset, NULL));
}
return result;
OpenPOWER on IntegriCloud