- dm_dbg(" - found match at '%s'\n", entry->name);
- ret = device_bind(parent, entry, name, NULL, offset, &dev);
+ dm_warn("Device tree error at node '%s'\n", name);
+ return compat_length;
+ }
+
+ /*
+ * Walk through the compatible string list, attempting to match each
+ * compatible string in order such that we match in order of priority
+ * from the first string to the last.
+ */
+ for (i = 0; i < compat_length; i += strlen(compat) + 1) {
+ compat = compat_list + i;
+ pr_debug(" - attempt to match compatible string '%s'\n",
+ compat);
+
+ for (entry = driver; entry != driver + n_ents; entry++) {
+ ret = driver_check_compatible(entry->of_match, &id,
+ compat);
+ if (!ret)
+ break;
+ }
+ if (entry == driver + n_ents)
+ continue;
+
+ pr_debug(" - found match at '%s'\n", entry->name);
+ ret = device_bind_with_driver_data(parent, entry, name,
+ id->data, node, &dev);
+ if (ret == -ENODEV) {
+ pr_debug("Driver '%s' refuses to bind\n", entry->name);
+ continue;
+ }