devicetree: Single scan_bridges()

Change-Id: Ifd277992a69a4182e2fac92aaf746abe4fec2a1b
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/8540
Tested-by: build bot (Jenkins)
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Kyösti Mälkki
2015-02-20 21:28:31 +02:00
parent de271a8f0a
commit 2d2367cd95
4 changed files with 21 additions and 21 deletions

View File

@@ -916,15 +916,15 @@ int reset_bus(struct bus *bus)
* @param max Current bus number.
* @return The maximum bus number found, after scanning all subordinate buses.
*/
unsigned int scan_bus(struct device *busdev, unsigned int max)
static unsigned int scan_bus(struct device *busdev, unsigned int max)
{
unsigned int new_max;
int do_scan_bus;
if (!busdev || !busdev->enabled || !busdev->ops ||
!busdev->ops->scan_bus) {
if (!busdev->enabled)
return max;
}
printk(BIOS_SPEW, "%s scanning...\n", dev_path(busdev));
post_log_path(busdev);
@@ -945,6 +945,19 @@ unsigned int scan_bus(struct device *busdev, unsigned int max)
return new_max;
}
void scan_bridges(struct bus *bus)
{
struct device *child;
unsigned int max = bus->secondary;
for (child = bus->children; child; child = child->sibling) {
if (!child->ops || !child->ops->scan_bus)
continue;
max = scan_bus(child, max);
}
bus->subordinate = max;
}
/**
* Determine the existence of devices and extend the device tree.
*