summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-04-17 12:25:23 +0200
committerMichael Niewöhner <foss@mniewoehner.de>2021-04-19 10:44:59 +0000
commit6205e038283ebc65087cb8e3798d54fb15edc732 (patch)
tree7ab424c53d3746134dbaed45aa1a6c223b30f5d7
parent8a10aff35aa723d639ae627ab1fc56accc036f64 (diff)
soc/intel/common/block/pcr: Define __SIMPLE_DEVICE__
Change-Id: I06f9c623947e48a7213e42507f4da51c12b425d7 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/52458 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
-rw-r--r--src/soc/intel/common/block/pcr/pcr.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/soc/intel/common/block/pcr/pcr.c b/src/soc/intel/common/block/pcr/pcr.c
index 03f0a0aec5..96b93ad37a 100644
--- a/src/soc/intel/common/block/pcr/pcr.c
+++ b/src/soc/intel/common/block/pcr/pcr.c
@@ -1,5 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#define __SIMPLE_DEVICE__
+
#include <device/mmio.h>
#include <assert.h>
#include <console/console.h>
@@ -208,11 +210,7 @@ void pcr_or8(uint8_t pid, uint16_t offset, uint8_t ordata)
#if !CONFIG(PCR_COMMON_IOSF_1_0)
-#ifdef __SIMPLE_DEVICE__
-static int pcr_wait_for_completion(pci_devfn_t dev)
-#else
-static int pcr_wait_for_completion(struct device *dev)
-#endif
+static int pcr_wait_for_completion(const pci_devfn_t dev)
{
struct stopwatch sw;
@@ -245,11 +243,7 @@ static int pcr_wait_for_completion(struct device *dev)
int pcr_execute_sideband_msg(struct pcr_sbi_msg *msg, uint32_t *data,
uint8_t *response)
{
-#if defined(__SIMPLE_DEVICE__)
- pci_devfn_t dev = PCH_DEV_P2SB;
-#else
- struct device *dev = PCH_DEV_P2SB;
-#endif
+ const pci_devfn_t dev = PCH_DEV_P2SB;
uint32_t sbi_data;
uint16_t sbi_status;
uint16_t sbi_rid;