diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2022-01-11 12:33:08 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2022-01-14 10:36:39 +0100 |
commit | 322a601b297b8ade1443d8aeb6606d12290ef726 (patch) | |
tree | dabd9bd7eef2617b517acf89f1719c91da08ee7d | |
parent | 60f61e974042a71ff039c36a431a270eeb730ef4 (diff) |
broadband-modem-qmi: if UNSUPPORTED, ignore power update operation
We were returning success on this operation upon an UNSUPPORTED error,
and we should keep on doing the same after all the indication support
changes.
-rw-r--r-- | src/mm-broadband-modem-qmi.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c index c157a375..cbef1e9e 100644 --- a/src/mm-broadband-modem-qmi.c +++ b/src/mm-broadband-modem-qmi.c @@ -1821,15 +1821,7 @@ dms_set_operating_mode_ready (QmiClientDms *client, ctx = g_task_get_task_data (self->priv->set_operating_mode_task); output = qmi_client_dms_set_operating_mode_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - /* If unsupported, just complete without errors */ - if (g_error_matches (error, QMI_CORE_ERROR, QMI_CORE_ERROR_UNSUPPORTED)) { - mm_obj_dbg (self, "device doesn't support operating mode setting: ignoring power update"); - g_clear_error (&error); - } - } else if (!qmi_message_dms_set_operating_mode_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't set operating mode: "); + if (!output || !qmi_message_dms_set_operating_mode_output_get_result (output, &error)) { /* * Some new devices, like the Dell DW5770, will return an internal error when * trying to bring the power mode to online. @@ -1846,10 +1838,16 @@ dms_set_operating_mode_ready (QmiClientDms *client, g_error_matches (error, QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR_INVALID_TRANSITION)))) { g_clear_error (&error); error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_RETRY, "Invalid transition"); - } + } else + g_prefix_error (&error, "Couldn't set operating mode: "); } - if (error) + /* If unsupported, just complete without errors */ + if (g_error_matches (error, QMI_CORE_ERROR, QMI_CORE_ERROR_UNSUPPORTED)) { + mm_obj_dbg (self, "device doesn't support operating mode setting: ignoring power update"); + g_clear_error (&error); + set_operating_mode_complete (self, NULL); + } else if (error) set_operating_mode_complete (self, error); else mm_obj_dbg (self, "operating mode request sent, waiting for power update indication"); |