summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2020-01-28 10:44:14 +0100
committerPatrick Delaunay <patrick.delaunay@st.com>2020-02-13 18:47:00 +0100
commitb10089233e27e6d6df0cb63cf6c25871b34c219a (patch)
tree64816d9f5eb42c5da2668a35aa458b6f4472156e
parent167a603b311a0431f71afc80a5e3807f1dde4564 (diff)
downloadu-boot-b10089233e27e6d6df0cb63cf6c25871b34c219a.tar.gz
pinctrl: stmfx: update the result type of dm_i2c_reg_read
Use int as result of dm_i2c_reg_read to avoid warning with W=1 (warning: comparison is always false due to limited range of data type [-Wtype-limits]) Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
-rw-r--r--drivers/pinctrl/pinctrl-stmfx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index c8e61e2918..b0e43ae0a1 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -352,11 +352,12 @@ static int stmfx_chip_init(struct udevice *dev)
int ret;
struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
- id = dm_i2c_reg_read(dev, STMFX_REG_CHIP_ID);
- if (id < 0) {
- dev_err(dev, "error reading chip id: %d\n", id);
+ ret = dm_i2c_reg_read(dev, STMFX_REG_CHIP_ID);
+ if (ret < 0) {
+ dev_err(dev, "error reading chip id: %d\n", ret);
return ret;
}
+ id = (u8)ret;
/*
* Check that ID is the complement of the I2C address:
* STMFX I2C address follows the 7-bit format (MSB), that's why