summaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2018-12-29 08:04:16 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2019-01-03 12:16:33 +0000
commite16c9df4542a40c176225e9db034e750eb957d5d (patch)
tree11b04c93bb55fd5b2e3eed47c131cc9f5a821ff2 /src/soc/intel/common/block
parente2c653e049d0c4db6c2712658eaa5838dac73ee9 (diff)
soc/intel: Fix bad uses of __SIMPLE_DEVICE__
Cases of *dev = PCI_DEV(b,d,f) are invalid. Not caught because files only build with __SIMPLE_DEVICE__ defined. Remove cases of testing __SIMPLE_DEVICE__ in files that are not build for ramstage. Change-Id: If10a0efa187c9b1d9a5577008aa46f050f0aa309 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/30497 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/soc/intel/common/block')
-rw-r--r--src/soc/intel/common/block/lpc/lpc_lib.c8
-rw-r--r--src/soc/intel/common/block/smm/smihandler.c5
2 files changed, 1 insertions, 12 deletions
diff --git a/src/soc/intel/common/block/lpc/lpc_lib.c b/src/soc/intel/common/block/lpc/lpc_lib.c
index bcbd8e6cbd..2fe5b39c0a 100644
--- a/src/soc/intel/common/block/lpc/lpc_lib.c
+++ b/src/soc/intel/common/block/lpc/lpc_lib.c
@@ -167,11 +167,7 @@ bool lpc_fits_fixed_mmio_window(uintptr_t base, size_t size)
*/
static void lpc_set_bios_control_reg(uint8_t bios_cntl_bit)
{
-#if defined(__SIMPLE_DEVICE__)
pci_devfn_t dev = PCH_DEV_LPC;
-#else
- struct device *dev = PCH_DEV_LPC;
-#endif
uint8_t bc_cntl;
assert(IS_POWER_OF_2(bios_cntl_bit));
@@ -214,11 +210,7 @@ void lpc_set_eiss(void)
*/
void lpc_set_serirq_mode(enum serirq_mode mode)
{
-#if defined(__SIMPLE_DEVICE__)
pci_devfn_t dev = PCH_DEV_LPC;
-#else
- struct device *dev = PCH_DEV_LPC;
-#endif
uint8_t scnt;
scnt = pci_read_config8(dev, LPC_SERIRQ_CTL);
diff --git a/src/soc/intel/common/block/smm/smihandler.c b/src/soc/intel/common/block/smm/smihandler.c
index 2ffc00f9d0..538028d76a 100644
--- a/src/soc/intel/common/block/smm/smihandler.c
+++ b/src/soc/intel/common/block/smm/smihandler.c
@@ -134,11 +134,8 @@ static void busmaster_disable_on_bus(int bus)
for (slot = 0; slot < 0x20; slot++) {
for (func = 0; func < 8; func++) {
u32 reg32;
-#if defined(__SIMPLE_DEVICE__)
+
pci_devfn_t dev = PCI_DEV(bus, slot, func);
-#else
- struct device *dev = PCI_DEV(bus, slot, func);
-#endif
if (!smihandler_soc_disable_busmaster(dev))
continue;