From 7dc1e790a807ed2685682286c0038b6584d8e11d Mon Sep 17 00:00:00 2001 From: Yong Cong Sin Date: Sat, 22 Jan 2022 01:41:57 +0800 Subject: [PATCH] drivers: modem: gsm: Init rssi_work_handle on gsm_init only Initializing rssi_work_handle on gsm_start would (re)init it unnecessarily everytime the gsm_start is invoked, we only need to initialize it once in the gsm_init. Signed-off-by: Yong Cong Sin --- drivers/modem/gsm_ppp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/modem/gsm_ppp.c b/drivers/modem/gsm_ppp.c index 144e341203..8d991993e9 100644 --- a/drivers/modem/gsm_ppp.c +++ b/drivers/modem/gsm_ppp.c @@ -1043,10 +1043,6 @@ void gsm_ppp_start(const struct device *dev) k_work_init_delayable(&gsm->gsm_configure_work, gsm_configure); (void)gsm_work_reschedule(&gsm->gsm_configure_work, K_NO_WAIT); - -#if defined(CONFIG_GSM_MUX) - k_work_init_delayable(&gsm->rssi_work_handle, rssi_handler); -#endif } void gsm_ppp_stop(const struct device *dev) @@ -1194,6 +1190,10 @@ static int gsm_init(const struct device *dev) K_PRIO_COOP(7), NULL); k_thread_name_set(&gsm->workq.thread, "gsm_workq"); +#if defined(CONFIG_GSM_MUX) + k_work_init_delayable(&gsm->rssi_work_handle, rssi_handler); +#endif + gsm->iface = ppp_net_if(); if (!gsm->iface) { LOG_ERR("Couldn't find ppp net_if!");