aboutsummaryrefslogtreecommitdiff
path: root/plugins/mm-plugin-sierra.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mm-plugin-sierra.c')
-rw-r--r--plugins/mm-plugin-sierra.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/plugins/mm-plugin-sierra.c b/plugins/mm-plugin-sierra.c
index 637f46d..8ace653 100644
--- a/plugins/mm-plugin-sierra.c
+++ b/plugins/mm-plugin-sierra.c
@@ -123,7 +123,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;
@@ -138,14 +138,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);
@@ -154,6 +146,7 @@ grab_port (MMPluginBase *base,
ptype = MM_PORT_TYPE_SECONDARY;
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) || (ptype != MM_PORT_TYPE_UNKNOWN)) {
modem = mm_modem_sierra_gsm_new (sysfs_path,
@@ -173,13 +166,10 @@ grab_port (MMPluginBase *base,
return NULL;
}
}
- } else {
- if ( (caps & (MM_PLUGIN_BASE_PORT_CAP_GSM | CAP_CDMA))
- || (ptype != MM_PORT_TYPE_UNKNOWN)) {
- modem = existing;
- if (!mm_modem_grab_port (modem, subsys, name, ptype, NULL, error))
- return NULL;
- }
+ } else if (get_level_for_capabilities (caps) || (ptype != MM_PORT_TYPE_UNKNOWN)) {
+ modem = existing;
+ if (!mm_modem_grab_port (modem, subsys, name, ptype, NULL, error))
+ return NULL;
}
return modem;