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>
This commit is contained in:
parent
c18aa1c777
commit
f51c5fd655
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue