summaryrefslogtreecommitdiff
path: root/src/device/pci_rom.c
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2021-07-16 15:06:56 -0600
committerFelix Held <felix-coreboot@felixheld.de>2021-07-20 16:52:35 +0000
commitad5307e46c63a8f293f5588f33ef3bade6f191e5 (patch)
treefe6f5b317111bf1b7e820ee52b8e9bf5d4df6b3d /src/device/pci_rom.c
parent69cb69f35fc3c5fa1e75b49ce0f9358acbc42ea8 (diff)
device/pci_rom: Make ON_DEVICE_ROM_LOAD condition truthy
Truthy conditions are easier to reason about. BUG=none TEST=Boot guybrush Signed-off-by: Raul E Rangel <rrangel@chromium.org> Change-Id: I229c3e90f5122d6191b28f9b4b6de79ac2fcb627 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56401 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Diffstat (limited to 'src/device/pci_rom.c')
-rw-r--r--src/device/pci_rom.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c
index fe7c1cfdf0..895c5b7737 100644
--- a/src/device/pci_rom.c
+++ b/src/device/pci_rom.c
@@ -68,11 +68,7 @@ struct rom_header *pci_rom_probe(const struct device *dev)
if (rom_header) {
printk(BIOS_DEBUG, "In CBFS, ROM address for %s = %p\n",
dev_path(dev), rom_header);
- } else if (!CONFIG(ON_DEVICE_ROM_LOAD)) {
- printk(BIOS_DEBUG, "PCI Option ROM loading disabled for %s\n",
- dev_path(dev));
- return NULL;
- } else {
+ } else if (CONFIG(ON_DEVICE_ROM_LOAD)) {
uintptr_t rom_address;
rom_address = pci_read_config32(dev, PCI_ROM_ADDRESS);
@@ -93,6 +89,10 @@ struct rom_header *pci_rom_probe(const struct device *dev)
printk(BIOS_DEBUG, "Option ROM address for %s = %lx\n",
dev_path(dev), (unsigned long)rom_address);
rom_header = (struct rom_header *)rom_address;
+ } else {
+ printk(BIOS_DEBUG, "PCI Option ROM loading disabled for %s\n",
+ dev_path(dev));
+ return NULL;
}
printk(BIOS_SPEW,