summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2018-01-30 09:58:51 -0700
committerAaron Durbin <adurbin@chromium.org>2018-02-01 00:13:58 +0000
commitfbed9a5facf3a2e9a28953f3a445801e57d716dd (patch)
tree96c3c14386d1db3a32869a9ee4211333345ae3a4
parent2a5e15ce1114587ba8d111bedd40afa9e28ff622 (diff)
downloadcoreboot-fbed9a5facf3a2e9a28953f3a445801e57d716dd.tar.xz
device/pci_device: remove #if/#endif in oprom logic
Use C if conditions instead of preprocessor macros. BUG=b:72400950 Change-Id: I8107f94b9ecb6f32c569cad0bcb3d51ab39aa35c Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/23504 Reviewed-by: Justin TerAvest <teravest@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Furquan Shaikh <furquan@google.com>
-rw-r--r--src/device/pci_device.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/device/pci_device.c b/src/device/pci_device.c
index dbe76b54f5..13ab1127da 100644
--- a/src/device/pci_device.c
+++ b/src/device/pci_device.c
@@ -664,7 +664,6 @@ void pci_dev_set_subsystem(struct device *dev, unsigned vendor, unsigned device)
((device & 0xffff) << 16) | (vendor & 0xffff));
}
-#if IS_ENABLED(CONFIG_VGA_ROM_RUN)
static int should_run_oprom(struct device *dev)
{
static int should_run = -1;
@@ -677,10 +676,9 @@ static int should_run_oprom(struct device *dev)
*/
should_run = display_init_required();
-#if IS_ENABLED(CONFIG_CHROMEOS)
- if (!should_run)
+ if (!should_run && IS_ENABLED(CONFIG_CHROMEOS))
should_run = vboot_wants_oprom();
-#endif
+
if (!should_run)
printk(BIOS_DEBUG, "Not running VGA Option ROM\n");
return should_run;
@@ -701,14 +699,15 @@ static int should_load_oprom(struct device *dev)
return 0;
}
-#endif /* CONFIG_VGA_ROM_RUN */
/** Default handler: only runs the relevant PCI BIOS. */
void pci_dev_init(struct device *dev)
{
-#if IS_ENABLED(CONFIG_VGA_ROM_RUN)
struct rom_header *rom, *ram;
+ if (!IS_ENABLED(CONFIG_VGA_ROM_RUN))
+ return;
+
/* Only execute VGA ROMs. */
if (((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA))
return;
@@ -730,7 +729,6 @@ void pci_dev_init(struct device *dev)
run_bios(dev, (unsigned long)ram);
gfx_set_init_done(1);
printk(BIOS_DEBUG, "VGA Option ROM was run\n");
-#endif /* CONFIG_VGA_ROM_RUN */
}
/** Default device operation for PCI devices */