aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-04-05 12:26:12 -0700
committerDan Williams <dcbw@redhat.com>2010-04-05 12:26:12 -0700
commit49c363d83af84021f74f04c8141313d21e75821b (patch)
treebc1bd766f27b3691fb4e878f875faf00d22a58a3
parent0108a36d27b84dee2bf1934f6d5403b7d683099a (diff)
core: fix handling of deferred ports during probe
The next plugin logic was wrong when a previous plugin had already claimed support for the port and the Generic plugin was next. In that case, the code failed to call the functions to actually grab the port.
-rw-r--r--src/mm-manager.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mm-manager.c b/src/mm-manager.c
index d3ebf6db..6a01cbd0 100644
--- a/src/mm-manager.c
+++ b/src/mm-manager.c
@@ -612,14 +612,17 @@ supports_callback (MMPlugin *plugin,
next_plugin = MM_PLUGIN (info->cur_plugin->data);
}
+ /* Don't bother with Generic if some other plugin already supports this port */
if (next_plugin) {
const char *next_name = mm_plugin_get_name (next_plugin);
- /* Try the next plugin, but don't bother with the Generic plugin if
- * something already supports this port.
- */
- if (!info->best_plugin || strcmp (next_name, MM_PLUGIN_GENERIC_NAME))
- try_supports_port (info->manager, next_plugin, existing, info);
+ if (info->best_plugin && strcmp (next_name, MM_PLUGIN_GENERIC_NAME))
+ next_plugin = NULL;
+ }
+
+ if (next_plugin) {
+ /* Try the next plugin */
+ try_supports_port (info->manager, next_plugin, existing, info);
} else {
/* All done; let the best modem grab the port */
info->done_id = g_idle_add (do_grab_port, info);