diff --git a/subsys/mgmt/hawkbit/hawkbit.c b/subsys/mgmt/hawkbit/hawkbit.c index d986b05f5718a81..3f5d5a8db1fc95d 100644 --- a/subsys/mgmt/hawkbit/hawkbit.c +++ b/subsys/mgmt/hawkbit/hawkbit.c @@ -92,7 +92,9 @@ static union { struct hawkbit_cancel cancel; } hawkbit_results; -static struct k_work_delayable hawkbit_work_handle; +static void autohandler(struct k_work *work); + +static K_WORK_DELAYABLE_DEFINE(hawkbit_work_handle, autohandler); static struct k_sem probe_sem; @@ -1238,6 +1240,5 @@ static void autohandler(struct k_work *work) void hawkbit_autohandler(void) { - k_work_init_delayable(&hawkbit_work_handle, autohandler); k_work_reschedule(&hawkbit_work_handle, K_NO_WAIT); }