From 4f748144b05375db436364e13186936eae6bcfd2 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 7 Nov 2016 17:47:55 +0100 Subject: [PATCH] port-probe: don't probe ignored ports If a port has been flagged as ignored with the ID_MM_PORT_IGNORE udev property, we shouldn't open and probe the ports in any way, just flag them as ignored. We still report them in the list of modem ports, but just with "unknown" type and therefore not using them for anything. --- src/mm-port-probe.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index 0b4d227b..f5dc90d2 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -1351,6 +1351,15 @@ mm_port_probe_run (MMPortProbe *self, /* The context will be owned by the task */ g_task_set_task_data (self->priv->task, ctx, (GDestroyNotify) port_probe_run_context_free); + /* If we're told to completely ignore the port, don't do any probing */ + if (self->priv->is_ignored) { + mm_dbg ("(%s/%s) port probing finished: skipping for blacklisted port", + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); + port_probe_task_return_boolean (self, TRUE); + return; + } + /* Check if we already have the requested probing results. * We will fix here the 'ctx->flags' so that we only request probing * for the missing things. */