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); caps = mm_plugin_base_supports_task_get_probed_capabilities (task);
if (!existing) { if (!(caps & MM_PLUGIN_BASE_PORT_CAP_GSM) && strcmp (subsys, "net"))
if (caps & MM_PLUGIN_BASE_PORT_CAP_GSM) { goto out;
modem = mm_modem_hso_new (sysfs_path,
mm_plugin_base_supports_task_get_driver (task),
mm_plugin_get_name (MM_PLUGIN (base)));
}
if (!existing) {
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 (modem) {
if (!mm_modem_grab_port (modem, subsys, name, NULL, error)) { if (!mm_modem_grab_port (modem, subsys, name, NULL, error)) {
g_object_unref (modem); g_object_unref (modem);
@@ -147,11 +147,9 @@ grab_port (MMPluginBase *base,
} }
} }
} else { } else {
if (caps & MM_PLUGIN_BASE_PORT_CAP_GSM) { modem = existing;
modem = existing; if (!mm_modem_grab_port (modem, subsys, name, NULL, error))
if (!mm_modem_grab_port (modem, subsys, name, NULL, error)) return NULL;
return NULL;
}
} }
out: out: