Michael Niewöhner has submitted this change. ( https://review.coreboot.org/c/coreboot/+/52459 )
Change subject: soc/intel/braswell/pmutil.c: Define __SIMPLE_DEVICE__ ......................................................................
soc/intel/braswell/pmutil.c: Define __SIMPLE_DEVICE__
Change-Id: I2caa9cbb812e17f041c15654aef756e41fb71398 Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/52459 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org Reviewed-by: Michael Niewöhner foss@mniewoehner.de Reviewed-by: Frans Hendriks fhendriks@eltan.com --- M src/soc/intel/braswell/pmutil.c 1 file changed, 3 insertions(+), 21 deletions(-)
Approvals: build bot (Jenkins): Verified Frans Hendriks: Looks good to me, approved Tim Wawrzynczak: Looks good to me, approved Michael Niewöhner: Looks good to me, approved
diff --git a/src/soc/intel/braswell/pmutil.c b/src/soc/intel/braswell/pmutil.c index 4497166..a880183 100644 --- a/src/soc/intel/braswell/pmutil.c +++ b/src/soc/intel/braswell/pmutil.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */
+#define __SIMPLE_DEVICE__ + #include <acpi/acpi.h> #include <arch/io.h> #include <assert.h> @@ -16,29 +18,9 @@ #include <stdint.h> #include <security/vboot/vbnv.h>
-#if defined(__SIMPLE_DEVICE__) - -static const pci_devfn_t pcu_dev = PCI_DEV(0, PCU_DEV, 0); - -static inline pci_devfn_t get_pcu_dev(void) -{ - return pcu_dev; -} - -#else /* __SIMPLE_DEVICE__ */ - -static struct device *pcu_dev; -static struct device *get_pcu_dev(void) -{ - if (pcu_dev == NULL) - pcu_dev = pcidev_on_root(PCU_DEV, 0); - return pcu_dev; -} -#endif /* __SIMPLE_DEVICE__ */ - uint16_t get_pmbase(void) { - return pci_read_config16(get_pcu_dev(), ABASE) & 0xfff8; + return pci_read_config16(PCI_DEV(0, PCU_DEV, 0), ABASE) & 0xfff8; }
static void print_num_status_bits(int num_bits, uint32_t status, const char *const bit_names[])