From ca432d1fd93986c52316ba78ed12ddd49d72c20b Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 15 Dec 2022 20:33:30 +0100 Subject: drivers/i2c/designware: translate return type in dw_i2c_dev_transfer dw_i2c_transfer returns an enum cb_err type, but dw_i2c_dev_transfer returns an int, so explicitly translate between the types. Since dw_i2c_transfer only returns either CB_SUCCESS or CB_ERR which are defined as 0 and -1, this won't change behavior of dw_i2c_dev_transfer. Signed-off-by: Felix Held Change-Id: Iaf2cbcf6564035d5c0fc13f5d5e7ac0d0425e85d Reviewed-on: https://review.coreboot.org/c/coreboot/+/70831 Tested-by: build bot (Jenkins) Reviewed-by: Fred Reitberger Reviewed-by: Eric Lai --- src/drivers/i2c/designware/dw_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/drivers') diff --git a/src/drivers/i2c/designware/dw_i2c.c b/src/drivers/i2c/designware/dw_i2c.c index a08036720b..3bcb51ab6c 100644 --- a/src/drivers/i2c/designware/dw_i2c.c +++ b/src/drivers/i2c/designware/dw_i2c.c @@ -862,7 +862,7 @@ static int dw_i2c_dev_transfer(struct device *dev, printk(BIOS_ERR, "Invalid I2C bus number.\n"); return -1; } - return dw_i2c_transfer(bus, msg, count); + return dw_i2c_transfer(bus, msg, count) == CB_SUCCESS ? 0 : -1; } const struct i2c_bus_operations dw_i2c_bus_ops = { -- cgit v1.2.3