MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / ofw_prop_match

Function ofw_prop_match

components/drivers/ofw/base.c:435–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435static struct rt_ofw_node_id *ofw_prop_match(struct rt_ofw_prop *prop, const struct rt_ofw_node_id *ids)
436{
437 int best_index = RT_UINT32_MAX >> 1, index;
438 struct rt_ofw_node_id *found_id = RT_NULL, *id;
439
440 for (id = (struct rt_ofw_node_id *)ids; id->compatible[0]; ++id)
441 {
442 index = ofw_prop_index_of_compatible(prop, id->compatible);
443
444 if (index >= 0 && index < best_index)
445 {
446 found_id = id;
447 best_index = index;
448 }
449 }
450
451 return found_id;
452}
453
454struct rt_ofw_node_id *rt_ofw_prop_match(struct rt_ofw_prop *prop, const struct rt_ofw_node_id *ids)
455{

Callers 2

rt_ofw_prop_matchFunction · 0.85
rt_ofw_node_matchFunction · 0.85

Calls 1

Tested by

no test coverage detected