espi: Fix gpio_manage_callback() logic

espi_manage_callback() returns -EINVAL if it could not remove
callback. However if the list is empty success is returned when trying
to remove callback.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2022-09-30 18:18:02 +03:00 committed by Fabio Baltieri
parent 005a4d8a31
commit a657abae23

View file

@ -32,6 +32,8 @@ static inline int espi_manage_callback(sys_slist_t *callbacks,
return -EINVAL;
}
}
} else if (!set) {
return -EINVAL;
}
if (set) {