Skip to content

Commit f491274

Browse files
Aymane-STfpistm
authored andcommitted
fix(i3c): fix enableIbi return value handling
Signed-off-by: Aymane Bahssain <aymane.bahssain@st.com>
1 parent 90f33e3 commit f491274

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎libraries/I3C/src/I3C.cpp‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,18 +1615,15 @@ int I3CBus::enableIbi(uint8_t deviceIndex,
16151615
int result = -1;
16161616

16171617
if (_initialized && (_hi3c.Mode == HAL_I3C_MODE_CONTROLLER)) {
1618-
int rc = configureControllerDevice(deviceIndex,
1618+
result = configureControllerDevice(deviceIndex,
16191619
dynAddr,
16201620
true,
16211621
withPayload,
16221622
false,
16231623
stopTransfer);
16241624

1625-
if (rc != 0) {
1626-
result = rc;
1627-
} else {
1628-
rc = setEvents(dynAddr, true, I3C_CCC_EVT_INTR, timeout);
1629-
result = rc;
1625+
if (result == 0) {
1626+
result = setEvents(dynAddr, true, I3C_CCC_EVT_INTR, timeout) ? 0 : -1;
16301627
}
16311628
}
16321629

0 commit comments

Comments
 (0)