input: ili2132a: check i2c_read_dt return value
Check i2c_read_dt return value in ili2132a_process, fixes a coverity warning. Link: https://github.com/zephyrproject-rtos/zephyr/issues/81965 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
committed by
Anas Nashif
parent
184c0f9e9d
commit
48cb3a2272
@@ -44,8 +44,14 @@ static void ili2132a_process(const struct device *dev)
|
||||
const struct ili2132a_config *dev_cfg = dev->config;
|
||||
uint8_t buf[8];
|
||||
uint16_t x, y;
|
||||
int ret;
|
||||
|
||||
ret = i2c_read_dt(&dev_cfg->i2c, buf, sizeof(buf));
|
||||
if (ret < 0) {
|
||||
LOG_ERR("Failed to read data: %d", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
i2c_read_dt(&dev_cfg->i2c, buf, sizeof(buf));
|
||||
if (buf[TIP] & IS_TOUCHED_BIT) {
|
||||
x = sys_get_le16(&buf[X_COORD]);
|
||||
y = sys_get_le16(&buf[Y_COORD]);
|
||||
|
||||
Reference in New Issue
Block a user