summaryrefslogtreecommitdiff
path: root/src/southbridge
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2017-09-09 20:45:47 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-09-10 03:22:43 +0000
commitf51c5fd655a5bc04b3ab39ca15c145d49f1007be (patch)
treef12e22aa351ec3d7538868ab07cd1d1d64169f89 /src/southbridge
parentc18aa1c777fadc02d5ffffa7bc2cf71cde784330 (diff)
sb/intel/common: Fix HAVE_DEBUG_SMBUS
Failed to build with DEBUG_SMBUS=y, slave_bytes is not initialized until inb(). Change-Id: Ia53717756ed74bc797a9529e36fc6965d6872101 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/21470 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/southbridge')
-rw-r--r--src/southbridge/intel/common/smbus.c5
1 files changed, 3 insertions, 2 deletions
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;