Skip to content

Commit fb33d58

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

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

17171717
if (_initialized && (_hi3c.Mode == HAL_I3C_MODE_CONTROLLER)) {
1718-
int rc = configureControllerDevice(deviceIndex,
1718+
result = configureControllerDevice(deviceIndex,
17191719
dynAddr,
17201720
true,
17211721
withPayload,
17221722
false,
17231723
stopTransfer);
17241724

1725-
if (rc != 0) {
1726-
result = rc;
1727-
} else {
1728-
rc = setEvents(dynAddr, true, I3C_CCC_EVT_INTR, timeout);
1729-
result = rc;
1725+
if (result == 0) {
1726+
result = setEvents(dynAddr, true, I3C_CCC_EVT_INTR, timeout) ? 0 : -1;
17301727
}
17311728
}
17321729

0 commit comments

Comments
 (0)