From f51c5fd655a5bc04b3ab39ca15c145d49f1007be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sat, 9 Sep 2017 20:45:47 +0300 Subject: sb/intel/common: Fix HAVE_DEBUG_SMBUS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Failed to build with DEBUG_SMBUS=y, slave_bytes is not initialized until inb(). Change-Id: Ia53717756ed74bc797a9529e36fc6965d6872101 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/21470 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans Reviewed-by: Paul Menzel --- src/southbridge/intel/common/smbus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/southbridge') diff --git a/src/southbridge/intel/common/smbus.c b/src/southbridge/intel/common/smbus.c index 2067baa8b2..e6b1188faa 100644 --- a/src/southbridge/intel/common/smbus.c +++ b/src/southbridge/intel/common/smbus.c @@ -263,11 +263,12 @@ int do_smbus_block_read(unsigned int smbus_base, u8 device, u8 cmd, } } while ((status & SMBHSTSTS_HOST_BUSY) && loops); + /* Post-check we received complete message. */ + slave_bytes = inb(smbus_base + SMBHSTDAT0); + dprintk("%s: status = %02x, len = %d / %d, loops = %d\n", __func__, status, bytes_read, slave_bytes, loops); - /* Post-check we received complete message. */ - slave_bytes = inb(smbus_base + SMBHSTDAT0); if (bytes_read < slave_bytes) return SMBUS_ERROR; -- cgit v1.2.3