port-probe: minor refactor in QCDM probing

This commit is contained in:
Aleksander Morgado
2023-03-27 12:37:56 +02:00
committed by Aleksander Morgado
parent e5493127cd
commit 7787c34af0

View File

@@ -747,9 +747,8 @@ serial_probe_qcdm (MMPortProbe *self)
GByteArray *verinfo2; GByteArray *verinfo2;
gint len; gint len;
guint8 marker = 0x7E; guint8 marker = 0x7E;
PortProbeRunContext *ctx;
MMPortSubsys subsys = MM_PORT_SUBSYS_TTY; MMPortSubsys subsys = MM_PORT_SUBSYS_TTY;
PortProbeRunContext *ctx;
g_assert (self->priv->task); g_assert (self->priv->task);
ctx = g_task_get_task_data (self->priv->task); ctx = g_task_get_task_data (self->priv->task);
@@ -761,15 +760,14 @@ serial_probe_qcdm (MMPortProbe *self)
/* Check if port requires QCDM probing */ /* Check if port requires QCDM probing */
if (!ctx->qcdm_required) { if (!ctx->qcdm_required) {
/* Ok, this is probably a QCDM port */ mm_obj_dbg (self, "Maybe a QCDM port, but plugin does not require probing and grabbing...");
mm_obj_dbg (self, "Likely a QCDM port, but plugin does not require probing and grabbing...");
mm_port_probe_set_result_qcdm (self, TRUE); mm_port_probe_set_result_qcdm (self, TRUE);
self->priv->is_ignored = TRUE; self->priv->is_ignored = TRUE;
/* Reschedule probing */ /* Reschedule probing */
serial_probe_schedule (self); serial_probe_schedule (self);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} else { }
mm_obj_dbg (self, "probing QCDM..."); mm_obj_dbg (self, "probing QCDM...");
/* If open, close the AT port */ /* If open, close the AT port */
@@ -846,10 +844,8 @@ serial_probe_qcdm (MMPortProbe *self)
(GAsyncReadyCallback) serial_probe_qcdm_parse_response, (GAsyncReadyCallback) serial_probe_qcdm_parse_response,
self); self);
g_byte_array_unref (verinfo); g_byte_array_unref (verinfo);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }
}
/***************************************************************/ /***************************************************************/
/* AT */ /* AT */