devicetree: Change scan_bus() prototype in device ops
The input/output value max is no longer used for tracking the bus enumeration sequence, everything is handled in the context of devicetree bus objects. Change-Id: I545088bd8eaf205b1436d8c52d3bc7faf4cfb0f9 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/8541 Tested-by: build bot (Jenkins) Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com> Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
@@ -913,16 +913,13 @@ int reset_bus(struct bus *bus)
|
||||
* required, reset the bus and scan it again.
|
||||
*
|
||||
* @param busdev Pointer to the bus device.
|
||||
* @param max Current bus number.
|
||||
* @return The maximum bus number found, after scanning all subordinate buses.
|
||||
*/
|
||||
static unsigned int scan_bus(struct device *busdev, unsigned int max)
|
||||
static void scan_bus(struct device *busdev)
|
||||
{
|
||||
unsigned int new_max;
|
||||
int do_scan_bus;
|
||||
|
||||
if (!busdev->enabled)
|
||||
return max;
|
||||
return;
|
||||
|
||||
printk(BIOS_SPEW, "%s scanning...\n", dev_path(busdev));
|
||||
|
||||
@@ -931,7 +928,7 @@ static unsigned int scan_bus(struct device *busdev, unsigned int max)
|
||||
do_scan_bus = 1;
|
||||
while (do_scan_bus) {
|
||||
struct bus *link;
|
||||
new_max = busdev->ops->scan_bus(busdev, max);
|
||||
busdev->ops->scan_bus(busdev);
|
||||
do_scan_bus = 0;
|
||||
for (link = busdev->link_list; link; link = link->next) {
|
||||
if (link->reset_needed) {
|
||||
@@ -942,20 +939,17 @@ static 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);
|
||||
scan_bus(child);
|
||||
}
|
||||
bus->subordinate = max;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -999,7 +993,7 @@ void dev_enumerate(void)
|
||||
printk(BIOS_ERR, "dev_root missing scan_bus operation");
|
||||
return;
|
||||
}
|
||||
scan_bus(root, 0);
|
||||
scan_bus(root);
|
||||
post_log_clear();
|
||||
printk(BIOS_INFO, "done\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user