| 539 | } |
| 540 | |
| 541 | static 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 | |
| 569 | rt_err_t rt_pci_ofw_device_init(struct rt_pci_device *pdev) |
| 570 | { |
no test coverage detected