From c7267dc26a7789bf5f84b79ddb1ddcfd9ebc7bc2 Mon Sep 17 00:00:00 2001 From: Yong Cong Sin Date: Sat, 5 Mar 2022 00:21:58 +0800 Subject: [PATCH] drivers: modem: gsm: remove mux_enabled flag and checks mux_enabled check in the gsm_configure is unnecessary since it is init and scheduled by gsm_ppp_start which means that the mux must be disabled. The IS_ENABLED(CONFIG_GSM_MUX) check should be good enough to determine whether or not the mux_enable function should be ran. Signed-off-by: Yong Cong Sin --- drivers/modem/gsm_ppp.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/modem/gsm_ppp.c b/drivers/modem/gsm_ppp.c index ffc6760b770..6f48f4bea49 100644 --- a/drivers/modem/gsm_ppp.c +++ b/drivers/modem/gsm_ppp.c @@ -107,7 +107,6 @@ static struct gsm_modem { int register_retries; int rssi_retries; int attach_retries; - bool mux_enabled : 1; bool attached : 1; bool modem_info_queried : 1; @@ -1071,7 +1070,6 @@ static void mux_setup(struct k_work *work) goto unlock; fail: gsm->state = STATE_INIT; - gsm->mux_enabled = false; unlock: gsm_ppp_unlock(gsm); } @@ -1102,15 +1100,13 @@ static void gsm_configure(struct k_work *work) goto reschedule; } - if (IS_ENABLED(CONFIG_GSM_MUX) && ret == 0 && - gsm->mux_enabled == false) { + if (IS_ENABLED(CONFIG_GSM_MUX)) { if (mux_enable(gsm)) { LOG_DBG("GSM muxing %s", "disabled"); goto reschedule; } LOG_DBG("GSM muxing %s", "enabled"); - gsm->mux_enabled = true; gsm->state = STATE_INIT; @@ -1164,8 +1160,6 @@ void gsm_ppp_stop(const struct device *dev) (void)k_sem_take(&gsm->sem_if_down, K_FOREVER); if (IS_ENABLED(CONFIG_GSM_MUX)) { - /* Lower mux_enabled flag to trigger re-sending AT+CMUX etc */ - gsm->mux_enabled = false; if (gsm->ppp_dev) { uart_mux_disable(gsm->ppp_dev);