libpayload: Correct a constant used for scanning for USB controllers.
When checking to see if a PCI device exists at a particular bus/dev/func, libpayload was checking the vendor and device id fields together against a 16 bit 0xffff. The two fields together are 32 bits, however, so the check was never true, and all dev/func combinations on a particular bus would be checked. That was slightly wasteful, but had relatively small impact. Change-Id: Iad537295c33083243940b18e7a99af92857e1ef2 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2521 Tested-by: build bot (Jenkins) Reviewed-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
This commit is contained in:
parent
b4523bb691
commit
37ef52d44b
|
@ -123,7 +123,7 @@ static void usb_scan_pci_bus(int bus)
|
||||||
u8 header_type;
|
u8 header_type;
|
||||||
pcidev_t addr = PCI_DEV(bus, dev, 0);
|
pcidev_t addr = PCI_DEV(bus, dev, 0);
|
||||||
/* Check if there's a device here at all. */
|
/* Check if there's a device here at all. */
|
||||||
if (pci_read_config32(addr, REG_VENDOR_ID) == 0xffff)
|
if (pci_read_config32(addr, REG_VENDOR_ID) == 0xffffffff)
|
||||||
continue;
|
continue;
|
||||||
header_type = pci_read_config8(addr, REG_HEADER_TYPE);
|
header_type = pci_read_config8(addr, REG_HEADER_TYPE);
|
||||||
/* If this is a bridge, scan the bus on the other side. */
|
/* If this is a bridge, scan the bus on the other side. */
|
||||||
|
|
Loading…
Reference in New Issue