While searching a sysfs node for suppliers to add as dependencies, we
also consider suppliers of its parent nodes as dependencies. The code
doing so doesn't explore suppliers-of-suppliers chains, which is meant
to be handled elsewhere. More importantly it misses the parent nodes of
the devices themselves, parents-of-suppliers chains, and their
dependencies; all of which is necessary to get a device working.
Consider the parent nodes of a sysfs node as a supplier dependency when
building the `module_suppliers` hashmap. So the suppliers-of-suppliers
handling elsewhere can work with any combination of parent/supplier
relation.
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
closedir(d);
}
strcat(node_path, "/.."); // Also find suppliers of parents
+ char *parent_path = realpath(node_path, NULL);
+ if (parent_path != NULL)
+ if (hashmap_put(suppliers, parent_path, parent_path) < 0)
+ free(parent_path);
}
}