aboutsummaryrefslogtreecommitdiff
path: root/plugins/telit/mm-common-telit.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-02-07 11:53:13 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-02-24 20:47:57 +0100
commit1b35d74c157417e40877535eec757e5cd725564f (patch)
treee9e26fb80e9d7f3141d017dd84b6e41a7a4783f5 /plugins/telit/mm-common-telit.c
parentcc07d21410d707a3e3cf16c3fa187562dcdea58b (diff)
kernel-device: add get_interface_number() method
We already have methods to query for interface specific attributes like class/subclass/protocol, so add a new one for the interface number, and make sure we use ATTRS{bInterfaceNumber} to load it always, instead of assuming the ID_USB_INTERFACE_NUM property is set.
Diffstat (limited to 'plugins/telit/mm-common-telit.c')
-rw-r--r--plugins/telit/mm-common-telit.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/telit/mm-common-telit.c b/plugins/telit/mm-common-telit.c
index f53f5b75..2e0b3801 100644
--- a/plugins/telit/mm-common-telit.c
+++ b/plugins/telit/mm-common-telit.c
@@ -59,7 +59,7 @@ telit_grab_port (MMPlugin *self,
if (g_object_get_data (G_OBJECT (device), TAG_GETPORTCFG_SUPPORTED) != NULL) {
guint usbif;
- usbif = mm_kernel_device_get_property_as_int_hex (port, "ID_USB_INTERFACE_NUM");
+ usbif = (guint) mm_kernel_device_get_interface_number (port);
if (usbif == GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (device), TAG_TELIT_MODEM_PORT))) {
mm_obj_dbg (self, "AT port '%s/%s' flagged as primary",
mm_port_probe_get_port_subsys (probe),
@@ -257,9 +257,7 @@ telit_custom_init_step (GTask *task)
* is always linked to an AT port
*/
port = mm_port_probe_peek_port (probe);
- if (!ctx->getportcfg_done &&
- g_strcmp0 (mm_kernel_device_get_property (port, "ID_USB_INTERFACE_NUM"), "00") == 0) {
-
+ if (!ctx->getportcfg_done && mm_kernel_device_get_interface_number (port) == 0) {
if (ctx->getportcfg_retries == 0)
goto out;
ctx->getportcfg_retries--;