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>
diff --git a/src/southbridge/intel/common/smbus.c b/src/southbridge/intel/common/smbus.c
index 2067baa..e6b1188 100644
--- a/src/southbridge/intel/common/smbus.c
+++ b/src/southbridge/intel/common/smbus.c
@@ -263,11 +263,12 @@
}
} 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;