summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2022-12-15 20:33:30 +0100
committerFelix Held <felix-coreboot@felixheld.de>2022-12-16 19:41:50 +0000
commitca432d1fd93986c52316ba78ed12ddd49d72c20b (patch)
tree36ff84bccce8dec2308a9a570dd63a87f0775183 /src
parentb12caef23bc1b29c2e658f2b728cc4beac1e62b9 (diff)
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 <felix-coreboot@felixheld.de> Change-Id: Iaf2cbcf6564035d5c0fc13f5d5e7ac0d0425e85d Reviewed-on: https://review.coreboot.org/c/coreboot/+/70831 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/i2c/designware/dw_i2c.c2
1 files changed, 1 insertions, 1 deletions
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 = {