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

Function ofw_find_device

components/drivers/pci/ofw.c:541–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539}
540
541static struct rt_ofw_node *ofw_find_device(struct rt_ofw_node *np, rt_uint32_t devfn)
542{
543 struct rt_ofw_node *dev_np, *mfd_np;
544
545 rt_ofw_foreach_child_node(np, dev_np)
546 {
547 if (ofw_pci_devfn(dev_np) == devfn)
548 {
549 return dev_np;
550 }
551
552 if (rt_ofw_node_tag_equ(dev_np, "multifunc-device"))
553 {
554 rt_ofw_foreach_child_node(dev_np, mfd_np)
555 {
556 if (ofw_pci_devfn(mfd_np) == devfn)
557 {
558 rt_ofw_node_put(dev_np);
559
560 return mfd_np;
561 }
562 }
563 }
564 }
565
566 return RT_NULL;
567}
568
569rt_err_t rt_pci_ofw_device_init(struct rt_pci_device *pdev)
570{

Callers 1

rt_pci_ofw_device_initFunction · 0.85

Calls 3

ofw_pci_devfnFunction · 0.85
rt_ofw_node_tag_equFunction · 0.85
rt_ofw_node_putFunction · 0.85

Tested by

no test coverage detected