From 28dc7dce83131cdd54cad5b338af2f4b89d8969b Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Fri, 12 Jul 2019 13:10:19 +0300 Subject: soc/intel: Use config_of_path(SA_DEVFN_ROOT) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We do not want to disguise somewhat complex function calls as simple macros. Change-Id: I53324603c9ece1334c6e09d51338084166f7a585 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/34299 Reviewed-by: Furquan Shaikh Reviewed-by: Angel Pons Reviewed-by: David Guckian Tested-by: build bot (Jenkins) --- src/soc/intel/icelake/fsp_params.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/soc/intel/icelake/fsp_params.c') diff --git a/src/soc/intel/icelake/fsp_params.c b/src/soc/intel/icelake/fsp_params.c index 382b1843f4..ce162ef40f 100644 --- a/src/soc/intel/icelake/fsp_params.c +++ b/src/soc/intel/icelake/fsp_params.c @@ -29,13 +29,8 @@ static void parse_devicetree(FSP_S_CONFIG *params) { - struct device *dev = pcidev_on_root(0, 0); - if (!dev) { - printk(BIOS_ERR, "Could not find root device\n"); - return; - } - - const struct soc_intel_icelake_config *config = dev->chip_info; + const struct soc_intel_icelake_config *config; + config = config_of_path(SA_DEVFN_ROOT); for (int i = 0; i < CONFIG_SOC_INTEL_I2C_DEV_MAX; i++) params->SerialIoI2cMode[i] = config->SerialIoI2cMode[i]; @@ -55,8 +50,10 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd) { int i; FSP_S_CONFIG *params = &supd->FspsConfig; - struct device *dev = SA_DEV_ROOT; - config_t *config = dev->chip_info; + + struct device *dev; + struct soc_intel_icelake_config *config; + config = config_of_path(SA_DEVFN_ROOT); /* Parse device tree and enable/disable devices */ parse_devicetree(params); -- cgit v1.2.3