aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-plugin.c')
-rw-r--r--src/mm-plugin.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c
index c2b75f97..40362863 100644
--- a/src/mm-plugin.c
+++ b/src/mm-plugin.c
@@ -756,38 +756,19 @@ mm_plugin_supports_port_cancel (MMPlugin *plugin,
g_free (key);
}
+/*****************************************************************************/
+
MMBaseModem *
mm_plugin_create_modem (MMPlugin *self,
- GList *ports,
+ GList *port_probes,
GError **error)
{
MMBaseModem *modem = NULL;
MMPluginPrivate *priv = MM_PLUGIN_GET_PRIVATE (self);
- GList *probes = NULL;
GList *l;
const gchar *name, *subsys, *sysfs_path, *driver;
guint16 vendor = 0, product = 0;
- /* Get the port probe results for each of the ports */
- for (l = ports; l; l = g_list_next (l)) {
- MMPortProbe *probe;
- gchar *key;
-
- subsys = g_udev_device_get_subsystem (G_UDEV_DEVICE (l->data));
- name = g_udev_device_get_name (G_UDEV_DEVICE (l->data));
-
- key = get_key (subsys, name);
- probe = g_hash_table_lookup (priv->tasks, key);
- if (!probe)
- mm_warn ("(%s/%s) Ignoring port when creating modem with plugin '%s'",
- subsys,
- name,
- priv->name);
- else
- probes = g_list_prepend (probes, g_object_ref (probe));
- g_free (key);
- }
-
/* Get info from the first probe in the list */
subsys = mm_port_probe_get_port_subsys (probes->data);
name = mm_port_probe_get_port_name (probes->data);
@@ -809,7 +790,7 @@ mm_plugin_create_modem (MMPlugin *self,
error);
if (modem) {
/* Grab each port */
- for (l = probes; l; l = g_list_next (l)) {
+ for (l = port_probes; l; l = g_list_next (l)) {
GError *inner_error = NULL;
/* If grabbing a port fails, just warn. We'll decide if the modem is
@@ -831,7 +812,7 @@ mm_plugin_create_modem (MMPlugin *self,
g_clear_object (&modem);
}
- for (l = probes; l; l = g_list_next (l)) {
+ for (l = port_probes; l; l = g_list_next (l)) {
gchar *key;
key = get_key (mm_port_probe_get_port_subsys (l->data),
@@ -840,8 +821,6 @@ mm_plugin_create_modem (MMPlugin *self,
g_free (key);
}
- g_list_free_full (probes, (GDestroyNotify) g_object_unref);
-
return modem;
}