vt8237r: Simplify bootblock init to work around nested if() romcc problem

During the hackathon in Prague we discovered that romcc has a problem
compiling the previous nested if() statements correctly. This patch
makes the code a little simpler, and indeed works around the romcc issue.

Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6620 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Peter Stuge 2011-06-04 15:40:12 +00:00
parent 471f103e53
commit e1898b5fa1
1 changed files with 15 additions and 12 deletions

View File

@ -33,20 +33,23 @@ static void bootblock_southbridge_init(void)
dev = pci_locate_device_on_bus(PCI_ID(PCI_VENDOR_ID_VIA, dev = pci_locate_device_on_bus(PCI_ID(PCI_VENDOR_ID_VIA,
PCI_DEVICE_ID_VIA_VT8237R_LPC), 0); PCI_DEVICE_ID_VIA_VT8237R_LPC), 0);
if (dev == PCI_DEV_INVALID) { if (dev != PCI_DEV_INVALID)
goto found;
/* Power management controller */ /* Power management controller */
dev = pci_locate_device_on_bus(PCI_ID(PCI_VENDOR_ID_VIA, dev = pci_locate_device_on_bus(PCI_ID(PCI_VENDOR_ID_VIA,
PCI_DEVICE_ID_VIA_VT8237S_LPC), 0); PCI_DEVICE_ID_VIA_VT8237S_LPC), 0);
if (dev == PCI_DEV_INVALID) { if (dev != PCI_DEV_INVALID)
goto found;
/* Power management controller */ /* Power management controller */
dev = pci_locate_device_on_bus(PCI_ID(PCI_VENDOR_ID_VIA, dev = pci_locate_device_on_bus(PCI_ID(PCI_VENDOR_ID_VIA,
PCI_DEVICE_ID_VIA_VT8237A_LPC), 0); PCI_DEVICE_ID_VIA_VT8237A_LPC), 0);
if (dev == PCI_DEV_INVALID) if (dev == PCI_DEV_INVALID)
return; return;
}
}
found:
pci_write_config8(dev, 0x41, 0x7f); pci_write_config8(dev, 0x41, 0x7f);
} }