From 2a6cc959eeeacbecd6bc3370115ab99bb6e886d6 Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Fri, 11 Feb 2022 22:32:44 +0100 Subject: southbridge/amd/*/*/smbus.c: Reformat code and reduce difference Change-Id: I43644b757a5a85864162da6a35f7f2a5335f8007 Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/61880 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Felix Held --- src/southbridge/amd/pi/hudson/smbus.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/southbridge/amd/pi/hudson') diff --git a/src/southbridge/amd/pi/hudson/smbus.c b/src/southbridge/amd/pi/hudson/smbus.c index c418492731..43f8ca75d3 100644 --- a/src/southbridge/amd/pi/hudson/smbus.c +++ b/src/southbridge/amd/pi/hudson/smbus.c @@ -10,6 +10,7 @@ static int smbus_wait_until_ready(u32 smbus_io_base) { u32 loops; + loops = SMBUS_TIMEOUT; do { u8 val; @@ -20,12 +21,14 @@ static int smbus_wait_until_ready(u32 smbus_io_base) } outb(val, smbus_io_base + SMBHSTSTAT); } while (--loops); + return -2; /* time out */ } static int smbus_wait_until_done(u32 smbus_io_base) { u32 loops; + loops = SMBUS_TIMEOUT; do { u8 val; @@ -40,6 +43,7 @@ static int smbus_wait_until_done(u32 smbus_io_base) return 0; } } while (--loops); + return -3; /* timeout */ } @@ -97,8 +101,7 @@ int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val) return 0; } -int do_smbus_read_byte(u32 smbus_io_base, u32 device, - u32 address) +int do_smbus_read_byte(u32 smbus_io_base, u32 device, u32 address) { u8 byte; @@ -128,8 +131,7 @@ int do_smbus_read_byte(u32 smbus_io_base, u32 device, return byte; } -int do_smbus_write_byte(u32 smbus_io_base, u32 device, - u32 address, u8 val) +int do_smbus_write_byte(u32 smbus_io_base, u32 device, u32 address, u8 val) { u8 byte; @@ -159,8 +161,7 @@ int do_smbus_write_byte(u32 smbus_io_base, u32 device, return 0; } -void alink_ab_indx(u32 reg_space, u32 reg_addr, - u32 mask, u32 val) +void alink_ab_indx(u32 reg_space, u32 reg_addr, u32 mask, u32 val) { u32 tmp; @@ -181,8 +182,7 @@ void alink_ab_indx(u32 reg_space, u32 reg_addr, outl(0, AB_INDX); } -void alink_rc_indx(u32 reg_space, u32 reg_addr, u32 port, - u32 mask, u32 val) +void alink_rc_indx(u32 reg_space, u32 reg_addr, u32 port, u32 mask, u32 val) { u32 tmp; @@ -206,8 +206,7 @@ void alink_rc_indx(u32 reg_space, u32 reg_addr, u32 port, /* space = 0: AX_INDXC, AX_DATAC * space = 1: AX_INDXP, AX_DATAP */ -void alink_ax_indx(u32 space /*c or p? */, u32 axindc, - u32 mask, u32 val) +void alink_ax_indx(u32 space /*c or p? */, u32 axindc, u32 mask, u32 val) { u32 tmp; -- cgit v1.2.3