From 24f4623384d372345e63051ec3a3c3724faa226f Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Sat, 17 Apr 2021 12:08:15 +0200 Subject: [PATCH] soc/intel/common/block/smbus: Define __SIMPLE_DEVICE__ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I93f7918763d87f8fb50f39f9469694e73aeff37b Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/52455 Tested-by: build bot (Jenkins) Reviewed-by: Michael Niewöhner --- src/soc/intel/common/block/smbus/tco.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/soc/intel/common/block/smbus/tco.c b/src/soc/intel/common/block/smbus/tco.c index 8ec24b67fe..8cde3bf7f2 100644 --- a/src/soc/intel/common/block/smbus/tco.c +++ b/src/soc/intel/common/block/smbus/tco.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#define __SIMPLE_DEVICE__ + #include #include #include @@ -101,13 +103,7 @@ static void tco_enable_bar(void) { uint32_t reg32; uint16_t tcobase; -#if defined(__SIMPLE_DEVICE__) - int devfn = PCH_DEVFN_SMBUS; - pci_devfn_t dev = PCI_DEV(0, PCI_SLOT(devfn), PCI_FUNC(devfn)); -#else - struct device *dev; - dev = PCH_DEV_SMBUS; -#endif + const pci_devfn_t dev = PCH_DEV_SMBUS; /* Disable TCO in SMBUS Device first before changing Base Address */ reg32 = pci_read_config32(dev, TCOCTL);