diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2008-01-09 06:20:40 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-17 14:53:22 +1100 |
commit | 283029d16a882539ab0027afd94ac52858d050b2 (patch) | |
tree | 78ad81fba51de1fbafd30706f162dc9315690e8b /drivers/of/device.c | |
parent | 91bbbe22dbd6d156b7059af13adb26a978a45661 (diff) |
[POWERPC] Add of_find_matching_node() helper function
Similar to of_find_compatible_node(), of_find_matching_node() and
for_each_matching_node() allow you to iterate over the device tree
looking for specific nodes, except that they take of_device_id
tables instead of strings.
This also moves of_match_node() from driver/of/device.c to
driver/of/base.c to colocate it with the of_find_matching_node which
depends on it.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/of/device.c')
-rw-r--r-- | drivers/of/device.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c index 6245f060fb7..29681c4b700 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -10,35 +10,6 @@ #include <asm/errno.h> /** - * of_match_node - Tell if an device_node has a matching of_match structure - * @ids: array of of device match structures to search in - * @node: the of device structure to match against - * - * Low level utility function used by device matching. - */ -const struct of_device_id *of_match_node(const struct of_device_id *matches, - const struct device_node *node) -{ - while (matches->name[0] || matches->type[0] || matches->compatible[0]) { - int match = 1; - if (matches->name[0]) - match &= node->name - && !strcmp(matches->name, node->name); - if (matches->type[0]) - match &= node->type - && !strcmp(matches->type, node->type); - if (matches->compatible[0]) - match &= of_device_is_compatible(node, - matches->compatible); - if (match) - return matches; - matches++; - } - return NULL; -} -EXPORT_SYMBOL(of_match_node); - -/** * of_match_device - Tell if an of_device structure has a matching * of_match structure * @ids: array of of device match structures to search in |