aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2017-07-17 17:04:56 -0700
committerAleksander Morgado <aleksander@aleksander.es>2017-07-18 10:25:20 +0200
commit1bd9935b5aece6c5999c96df1acec86cfc00e6b1 (patch)
tree74708686f8ceeb30aa63880d6a31b25ae81b163d
parent38c53ed81405167e0632fb4ce36d787fb0c29c72 (diff)
telit: fix modem_set_current_bands to use g_task_report_new_error
Commit acf101335 ("telit: port mm-broadband-modem-telit to use GTask") ported most of the modem_set_current_bands code to use GTask, but missed a few g_simple_async_report_error_in_idle calls, which potentially leads to an incorrect G_TASK cast in modem_set_current_bands_finish.
-rw-r--r--plugins/telit/mm-broadband-modem-telit.c51
1 files changed, 27 insertions, 24 deletions
diff --git a/plugins/telit/mm-broadband-modem-telit.c b/plugins/telit/mm-broadband-modem-telit.c
index a8ee886c..513d75bc 100644
--- a/plugins/telit/mm-broadband-modem-telit.c
+++ b/plugins/telit/mm-broadband-modem-telit.c
@@ -360,32 +360,35 @@ modem_set_current_bands (MMIfaceModem *self,
is_4g = mm_iface_modem_is_4g (self);
if (is_2g && flag2g == -1) {
- g_simple_async_report_error_in_idle (G_OBJECT (self),
- callback,
- user_data,
- MM_CORE_ERROR,
- MM_CORE_ERROR_NOT_FOUND,
- "None or invalid 2G bands combination in the provided list");
+ g_task_report_new_error (self,
+ callback,
+ user_data,
+ modem_set_current_bands,
+ MM_CORE_ERROR,
+ MM_CORE_ERROR_NOT_FOUND,
+ "None or invalid 2G bands combination in the provided list");
return;
}
if (is_3g && flag3g == -1) {
- g_simple_async_report_error_in_idle (G_OBJECT (self),
- callback,
- user_data,
- MM_CORE_ERROR,
- MM_CORE_ERROR_NOT_FOUND,
- "None or invalid 3G bands combination in the provided list");
+ g_task_report_new_error (self,
+ callback,
+ user_data,
+ modem_set_current_bands,
+ MM_CORE_ERROR,
+ MM_CORE_ERROR_NOT_FOUND,
+ "None or invalid 3G bands combination in the provided list");
return;
}
if (is_4g && flag4g == -1) {
- g_simple_async_report_error_in_idle (G_OBJECT (self),
- callback,
- user_data,
- MM_CORE_ERROR,
- MM_CORE_ERROR_NOT_FOUND,
- "None or invalid 4G bands combination in the provided list");
+ g_task_report_new_error (self,
+ callback,
+ user_data,
+ modem_set_current_bands,
+ MM_CORE_ERROR,
+ MM_CORE_ERROR_NOT_FOUND,
+ "None or invalid 4G bands combination in the provided list");
return;
}
@@ -403,12 +406,12 @@ modem_set_current_bands (MMIfaceModem *self,
else if (is_2g && !is_3g && is_4g)
cmd = g_strdup_printf ("AT#BND=%d,0,%d", flag2g, flag4g);
else {
- g_simple_async_report_error_in_idle (G_OBJECT (self),
- callback,
- user_data,
- MM_CORE_ERROR,
- MM_CORE_ERROR_FAILED,
- "Unexpectd error: could not compose AT#BND command");
+ g_task_report_new_error (self,
+ callback,
+ user_data,
+ MM_CORE_ERROR,
+ MM_CORE_ERROR_FAILED,
+ "Unexpectd error: could not compose AT#BND command");
return;
}
task = g_task_new (self, NULL, callback, user_data);