From 25794d2a65049e1427ef04c5944343d11b4b0054 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 25 Jan 2018 17:52:59 -0700 Subject: [PATCH] soc/amd/stoneyridge: fix compilation error The following two patches were independent, but they were merged together. However, the first one changed the API that the second was originally was written against. Fix build. b94a2750 (i2c/designware: reduce API complication for bus config) 13101a7b (soc/amd/stoneyridge: Add I2C devicetree support) BUG=b:72121803 Change-Id: I3678a8f414572dd2227c42ce5585daf6bc933df5 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/23445 Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/soc/amd/stoneyridge/i2c.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/soc/amd/stoneyridge/i2c.c b/src/soc/amd/stoneyridge/i2c.c index d3e01090ff..d0d75a82d2 100644 --- a/src/soc/amd/stoneyridge/i2c.c +++ b/src/soc/amd/stoneyridge/i2c.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "chip.h" #define I2C_BUS_ADDRESS(x) (I2C_BASE_ADDRESS + I2C_DEVICE_SIZE * (x)) @@ -41,10 +42,11 @@ uintptr_t dw_i2c_base_address(unsigned int bus) return bus < I2C_DEVICE_COUNT ? i2c_bus_address[bus] : 0; } -const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus, - const struct device *dev) +const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus) { const struct soc_amd_stoneyridge_config *config; + const struct device *dev = dev_find_slot(0, GNB_DEVFN); + if (!dev || !dev->chip_info) { printk(BIOS_ERR, "%s: Could not find SoC devicetree config!\n", __func__);