From 27276bf8626894b3814791d0e170ee56c177e3f0 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 6 Dec 2018 14:14:58 +0100 Subject: [PATCH] iface-modem: remove redundant logic to update failed state When the MMIfaceModem initialization returns with the SIM_NOT_INSERTED error, the base logic is already updating the modem failed reason to SIM_MISSING. There is no need to do that explicitly for the case where SIM hot swap is supported. --- src/mm-iface-modem.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 03a680dd..4c952684 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -4984,21 +4984,7 @@ interface_initialization_step (GTask *task) G_CALLBACK (handle_factory_reset), self); - if (ctx->fatal_error) { - if (g_error_matches (ctx->fatal_error, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED)) { - gboolean is_sim_hot_swap_supported = FALSE; - - g_object_get (self, - MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED, &is_sim_hot_swap_supported, - NULL); - - if (is_sim_hot_swap_supported) { - mm_iface_modem_update_failed_state (self, MM_MODEM_STATE_FAILED_REASON_SIM_MISSING); - } - } - } else { + if (!ctx->fatal_error) { /* We are done without errors! * Handle method invocations */ g_signal_connect (ctx->skeleton,