drivers: regulator: Fix k_work_schedule return code handling

k_work_schedule may return other non-negative value than 0.
When driver was adapted to the new k_work API that was not
taken into account.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2021-09-23 18:01:44 +02:00 committed by Anas Nashif
commit 8e66894d4e

View file

@ -115,7 +115,7 @@ static void finalize_transition(struct driver_data_onoff *data,
data->task = WORK_TASK_DELAY;
data->notify = notify;
rc = k_work_schedule(&data->dwork, K_USEC(delay_us));
if (rc == 0) {
if (rc >= 0) {
return;
}
#endif /* CONFIG_MULTITHREADING */