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 <yongcong.sin@gmail.com>
This commit is contained in:
Yong Cong Sin 2022-01-22 01:41:57 +08:00 committed by Carles Cufí
parent b2dd782879
commit 7dc1e790a8

View file

@ -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!");