Skip to content

Commit a6c76c4

Browse files
ubiedakartben
authored andcommitted
drivers: i2c_rtio: max32: fix i2c_configure to return 0 on success
To comply with the API definition. This was caught by running i2c_ram test. Signed-off-by: Luis Ubieda <[email protected]>
1 parent 242f3e2 commit a6c76c4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/i2c/i2c_max32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static int api_configure(const struct device *dev, uint32_t dev_cfg)
100100
return -ENOTSUP;
101101
}
102102

103-
return ret;
103+
return ((ret > 0) ? 0 : -EIO);
104104
}
105105

106106
#ifdef CONFIG_I2C_TARGET

drivers/i2c/i2c_max32_rtio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static int max32_do_configure(const struct device *dev, uint32_t dev_cfg)
9797
return -ENOTSUP;
9898
}
9999

100-
return ret;
100+
return ((ret > 0) ? 0 : -EIO);
101101
}
102102

103103
static void max32_complete(const struct device *dev, int status);

0 commit comments

Comments
 (0)