broadband-modem-qmi: add a temporary assure_qmi_client() helper
ensure_qmi_client() uses g_simple_async_report_take_gerror_in_idle(), which can't be mixed with GTask. To allow migrating remaining MMBroadbandModemQmi code to use GTask in a series of smaller patches, this patch adds a temporary assure_qmi_client() helper, which mimics ensure_qmi_client() but uses g_task_report_new_error(). Once all the MMBroadbandModemQmi code is migrated to use GTask, we will drop the old ensure_qmi_client() and renames assure_qmi_client() back to ensure_qmi_client().
This commit is contained in:

committed by
Aleksander Morgado

parent
0e770b13f8
commit
641e1b8a43
@@ -187,6 +187,26 @@ ensure_qmi_client (MMBroadbandModemQmi *self,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
assure_qmi_client (MMBroadbandModemQmi *self,
|
||||
QmiService service,
|
||||
QmiClient **o_client,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GError *error = NULL;
|
||||
QmiClient *client;
|
||||
|
||||
client = peek_qmi_client (self, service, &error);
|
||||
if (!client) {
|
||||
g_task_report_error (self, callback, user_data, assure_qmi_client, error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*o_client = client;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Power cycle */
|
||||
|
||||
|
Reference in New Issue
Block a user