soc/intel/cannonlake/romstage: Reuse device pointer

Reuse `dev` pointer for SmbusEnable configuration and remove `smbus`
pointer.

Change-Id: I7ad7cdeb632eb52ae02b60ca51e7d4845dffdb0d
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52490
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Felix Singer 2021-04-19 01:42:33 +02:00 committed by Michael Niewöhner
parent 2a3689f0e4
commit b03e497ef1
1 changed files with 3 additions and 3 deletions

View File

@ -136,7 +136,6 @@ static void soc_memory_init_params(FSPM_UPD *mupd, const config_t *config)
void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd, uint32_t version) void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd, uint32_t version)
{ {
const struct device *dev = pcidev_path_on_root(PCH_DEVFN_LPC); const struct device *dev = pcidev_path_on_root(PCH_DEVFN_LPC);
const struct device *smbus = pcidev_path_on_root(PCH_DEVFN_SMBUS);
assert(dev != NULL); assert(dev != NULL);
const config_t *config = config_of(dev); const config_t *config = config_of(dev);
FSP_M_CONFIG *m_cfg = &mupd->FspmConfig; FSP_M_CONFIG *m_cfg = &mupd->FspmConfig;
@ -145,10 +144,11 @@ void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd, uint32_t version)
soc_memory_init_params(mupd, config); soc_memory_init_params(mupd, config);
/* Enable SMBus controller based on config */ /* Enable SMBus controller based on config */
if (!smbus) dev = pcidev_path_on_root(PCH_DEVFN_SMBUS);
if (!dev)
m_cfg->SmbusEnable = 0; m_cfg->SmbusEnable = 0;
else else
m_cfg->SmbusEnable = smbus->enabled; m_cfg->SmbusEnable = dev->enabled;
/* Set debug probe type */ /* Set debug probe type */
m_cfg->PlatformDebugConsent = m_cfg->PlatformDebugConsent =