From 49c363d83af84021f74f04c8141313d21e75821b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 5 Apr 2010 12:26:12 -0700 Subject: [PATCH] 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. --- src/mm-manager.c | 13 ++++++++----- 1 file 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);