aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mm-iface-modem.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index 83c184d0..cc12ef34 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -3728,15 +3728,17 @@ interface_initialization_step (InitializationContext *ctx)
}
/* Load primary port if not done before */
if (!mm_gdbus_modem_get_primary_port (ctx->skeleton)) {
- MMPort *primary;
+ MMPort *primary = NULL;
#if defined WITH_QMI
primary = MM_PORT (mm_base_modem_peek_port_qmi (MM_BASE_MODEM (ctx->self)));
+#endif
+#if defined WITH_MBIM
if (!primary)
- primary = MM_PORT (mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self)));
-#else
- primary = MM_PORT (mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self)));
+ primary = MM_PORT (mm_base_modem_peek_port_mbim (MM_BASE_MODEM (ctx->self)));
#endif
+ if (!primary)
+ primary = MM_PORT (mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self)));
g_assert (primary != NULL);
mm_gdbus_modem_set_primary_port (ctx->skeleton, mm_port_get_device (primary));