From 026863b2ffa132e1f206a86b3fbf9360c86138d3 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Thu, 21 Nov 2019 08:24:02 +0100 Subject: southbridge/intel/common/spi.c: Define __SIMPLE_DEVICE__ This simplifies PCI config space accessors. Change-Id: Idf0f90ee2dc1dcb0003ef5d56eff44ca9a5634e7 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/37079 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/southbridge/intel/common/spi.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c index 4926df9d50..3b7842de7d 100644 --- a/src/southbridge/intel/common/spi.c +++ b/src/southbridge/intel/common/spi.c @@ -15,6 +15,8 @@ * GNU General Public License for more details. */ +#define __SIMPLE_DEVICE__ + /* This file is derived from the flashrom project. */ #include #include @@ -274,11 +276,7 @@ static void ich_set_bbar(uint32_t minaddr) #define RCBA 0xf0 #define SBASE 0x54 -#ifdef __SIMPLE_DEVICE__ static void *get_spi_bar(pci_devfn_t dev) -#else -static void *get_spi_bar(struct device *dev) -#endif { uintptr_t rcba; /* Root Complex Register Block */ uintptr_t sbase; @@ -306,11 +304,7 @@ void spi_init(void) struct ich7_spi_regs *ich7_spi; uint16_t hsfs; -#ifdef __SIMPLE_DEVICE__ pci_devfn_t dev = PCI_DEV(0, 31, 0); -#else - struct device *dev = pcidev_on_root(31, 0); -#endif if (CONFIG(SOUTHBRIDGE_INTEL_I82801GX)) { ich7_spi = get_spi_bar(dev); -- cgit v1.2.3