Skip to content

Commit b2133ba

Browse files
committed
fix(i3c): fix enableIbi return value handling
Signed-off-by: Aymane Bahssain <aymane.bahssain@st.com>
1 parent 3449c5a commit b2133ba

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
@@ -1618,18 +1618,15 @@ int I3CBus::enableIbi(uint8_t deviceIndex,
16181618
int result = -1;
16191619

16201620
if (_initialized && (_hi3c.Mode == HAL_I3C_MODE_CONTROLLER)) {
1621-
int rc = configureControllerDevice(deviceIndex,
1621+
result = configureControllerDevice(deviceIndex,
16221622
dynAddr,
16231623
true,
16241624
withPayload,
16251625
false,
16261626
stopTransfer);
16271627

1628-
if (rc != 0) {
1629-
result = rc;
1630-
} else {
1631-
rc = setEvents(dynAddr, true, I3C_CCC_EVT_INTR, timeout);
1632-
result = rc;
1628+
if (result == 0) {
1629+
result = setEvents(dynAddr, true, I3C_CCC_EVT_INTR, timeout) ? 0 : -1;
16331630
}
16341631
}
16351632

0 commit comments

Comments
 (0)