Skip to content

Commit 35d05b7

Browse files
maass-hamburgfabiobaltieri
authored andcommitted
mgmt: hawkbit: use K_WORK_DELAYABLE_DEFINE
staticly init hawkbit_work_handle Signed-off-by: Fin Maaß <[email protected]>
1 parent 029540a commit 35d05b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

subsys/mgmt/hawkbit/hawkbit.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ int hawkbit_default_config_data_cb(const char *device_id, uint8_t *buffer,
145145
static hawkbit_config_device_data_cb_handler_t hawkbit_config_device_data_cb_handler =
146146
hawkbit_default_config_data_cb;
147147

148-
static struct k_work_delayable hawkbit_work_handle;
148+
static void autohandler(struct k_work *work);
149+
150+
static K_WORK_DELAYABLE_DEFINE(hawkbit_work_handle, autohandler);
149151

150152
K_SEM_DEFINE(probe_sem, 1, 1);
151153

@@ -1529,6 +1531,5 @@ static void autohandler(struct k_work *work)
15291531

15301532
void hawkbit_autohandler(void)
15311533
{
1532-
k_work_init_delayable(&hawkbit_work_handle, autohandler);
15331534
k_work_reschedule(&hawkbit_work_handle, K_NO_WAIT);
15341535
}

0 commit comments

Comments
 (0)