| 675 | } |
| 676 | |
| 677 | static void resource_tree(const struct device *root, int debug_level, int depth) |
| 678 | { |
| 679 | int i = 0; |
| 680 | struct device *child; |
| 681 | struct resource *res; |
| 682 | char indent[30]; /* If your tree has more levels, it's wrong. */ |
| 683 | |
| 684 | for (i = 0; i < depth + 1 && i < 29; i++) |
| 685 | indent[i] = ' '; |
| 686 | indent[i] = '\0'; |
| 687 | |
| 688 | printk(BIOS_DEBUG, "%s%s", indent, dev_path(root)); |
| 689 | if (root->downstream && root->downstream->children) |
| 690 | printk(BIOS_DEBUG, " child on link 0 %s", |
| 691 | dev_path(root->downstream->children)); |
| 692 | printk(BIOS_DEBUG, "\n"); |
| 693 | |
| 694 | for (res = root->resource_list; res; res = res->next) { |
| 695 | printk(debug_level, "%s%s resource base %llx size %llx " |
| 696 | "align %d gran %d limit %llx flags %lx index %lx\n", |
| 697 | indent, dev_path(root), res->base, res->size, |
| 698 | res->align, res->gran, res->limit, res->flags, |
| 699 | res->index); |
| 700 | } |
| 701 | |
| 702 | if (!root->downstream) |
| 703 | return; |
| 704 | |
| 705 | for (child = root->downstream->children; child; child = child->sibling) |
| 706 | resource_tree(child, debug_level, depth + 1); |
| 707 | } |
| 708 | |
| 709 | void print_resource_tree(const struct device *root, int debug_level, |
| 710 | const char *msg) |
no test coverage detected