diff options
Diffstat (limited to 'plugins/mm-plugin-option.c')
-rw-r--r-- | plugins/mm-plugin-option.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/plugins/mm-plugin-option.c b/plugins/mm-plugin-option.c index d4c402d..101f9bd 100644 --- a/plugins/mm-plugin-option.c +++ b/plugins/mm-plugin-option.c @@ -101,7 +101,7 @@ grab_port (MMPluginBase *base, MMPluginBaseSupportsTask *task, GError **error) { - GUdevDevice *port = NULL, *physdev = NULL; + GUdevDevice *port = NULL; MMModem *modem = NULL; const char *name, *subsys, *devfile, *sysfs_path; guint32 caps; @@ -117,14 +117,6 @@ grab_port (MMPluginBase *base, return NULL; } - physdev = mm_plugin_base_supports_task_get_physdev (task); - g_assert (physdev); - sysfs_path = g_udev_device_get_sysfs_path (physdev); - if (!sysfs_path) { - g_set_error (error, 0, 0, "Could not get port's physical device sysfs path."); - return NULL; - } - subsys = g_udev_device_get_subsystem (port); name = g_udev_device_get_name (port); @@ -138,6 +130,7 @@ grab_port (MMPluginBase *base, ptype = MM_PORT_TYPE_PRIMARY; caps = mm_plugin_base_supports_task_get_probed_capabilities (task); + sysfs_path = mm_plugin_base_supports_task_get_physdev_path (task); if (!existing) { if (caps & MM_PLUGIN_BASE_PORT_CAP_GSM) { modem = mm_modem_option_new (sysfs_path, @@ -151,12 +144,13 @@ grab_port (MMPluginBase *base, return NULL; } } - } else { - if (caps & MM_PLUGIN_BASE_PORT_CAP_GSM) { - modem = existing; - if (!mm_modem_grab_port (modem, subsys, name, ptype, NULL, error)) - return NULL; - } + } else if (get_level_for_capabilities (caps)) { + if (caps & MM_PLUGIN_BASE_PORT_CAP_QCDM) + ptype = MM_PORT_TYPE_QCDM; + + modem = existing; + if (!mm_modem_grab_port (modem, subsys, name, ptype, NULL, error)) + return NULL; } return modem; |