From b39714e5ee07deb36165d4c4f85b4b1effbd30c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 12 Mar 2015 16:16:59 +0200 Subject: HyperTransport: Move pci_scan_bus() call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows to remove parameter max from the call, it is not involved with the unitid assignment. Change-Id: I087622f4ff69474f0b27cfd8709106ab8ac4ca98 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/8687 Tested-by: build bot (Jenkins) Reviewed-by: Timothy Pearson Reviewed-by: Patrick Georgi --- src/device/hypertransport.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/device/hypertransport.c') diff --git a/src/device/hypertransport.c b/src/device/hypertransport.c index a15a021c5c..1a2e7ff2f4 100644 --- a/src/device/hypertransport.c +++ b/src/device/hypertransport.c @@ -249,7 +249,7 @@ static void ht_collapse_early_enumeration(struct bus *bus, } unsigned int hypertransport_scan_chain(struct bus *bus, unsigned min_devfn, - unsigned max_devfn, unsigned int max, + unsigned max_devfn, unsigned *ht_unitid_base, unsigned offset_unitid) { @@ -474,9 +474,7 @@ end_of_chain: last_func->sibling = old_devices; } - /* Now that nothing is overlapping it is safe to scan the children. */ - max = pci_scan_bus(bus, 0x00, ((next_unitid - 1) << 3) | 7, max); - return max; + return next_unitid; } /** @@ -498,8 +496,13 @@ static unsigned int hypertransport_scan_chain_x(struct bus *bus, { unsigned int ht_unitid_base[4]; unsigned int offset_unitid = 1; - return hypertransport_scan_chain(bus, min_devfn, max_devfn, max, + + unsigned int next_unitid = hypertransport_scan_chain(bus, min_devfn, max_devfn, ht_unitid_base, offset_unitid); + + /* Now that nothing is overlapping it is safe to scan the children. */ + max = pci_scan_bus(bus, 0x00, ((next_unitid - 1) << 3) | 7, max); + return max; } unsigned int ht_scan_bridge(struct device *dev, unsigned int max) -- cgit v1.2.3