Skip to content

Commit a94fa0e

Browse files
mstasiaknordicrlubos
authored andcommitted
[nrf fromlist] soc: nordic: nrf_sys_event: handle errors correctly
nrfx_power_constlat API returns negative value if the requested action has no effect, which is expected in cases of multiple requests/releases. Align nrf_sys_event to not treat it as an error. Upstream PR #: 100342 Signed-off-by: Michał Stasiak <[email protected]> (cherry picked from commit 796b28f)
1 parent 83cefa2 commit a94fa0e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

soc/nordic/common/nrf_sys_event.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,20 @@ int nrf_sys_event_release_global_constlat(void)
7676

7777
int nrf_sys_event_request_global_constlat(void)
7878
{
79-
return nrfx_power_constlat_mode_request();
79+
int err;
80+
81+
err = nrfx_power_constlat_mode_request();
82+
83+
return (err == 0 || err == -EALREADY) ? 0 : -EAGAIN;
8084
}
8185

8286
int nrf_sys_event_release_global_constlat(void)
8387
{
84-
return nrfx_power_constlat_mode_free();
88+
int err;
89+
90+
err = nrfx_power_constlat_mode_free();
91+
92+
return (err == 0 || err == -EBUSY) ? 0 : -EAGAIN;
8593
}
8694

8795
#endif

0 commit comments

Comments
 (0)