hso: fix grab of netdev port

This commit is contained in:
Dan Williams
2009-06-29 09:00:25 -04:00
parent 504b4991cd
commit c6d0174b41

View File

@@ -133,13 +133,13 @@ grab_port (MMPluginBase *base,
}
caps = mm_plugin_base_supports_task_get_probed_capabilities (task);
if (!(caps & MM_PLUGIN_BASE_PORT_CAP_GSM) && strcmp (subsys, "net"))
goto out;
if (!existing) {
if (caps & MM_PLUGIN_BASE_PORT_CAP_GSM) {
modem = mm_modem_hso_new (sysfs_path,
mm_plugin_base_supports_task_get_driver (task),
mm_plugin_get_name (MM_PLUGIN (base)));
}
if (modem) {
if (!mm_modem_grab_port (modem, subsys, name, NULL, error)) {
g_object_unref (modem);
@@ -147,12 +147,10 @@ grab_port (MMPluginBase *base,
}
}
} else {
if (caps & MM_PLUGIN_BASE_PORT_CAP_GSM) {
modem = existing;
if (!mm_modem_grab_port (modem, subsys, name, NULL, error))
return NULL;
}
}
out:
g_free (devfile);