aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2018-08-06 10:15:36 +0200
committerDan Williams <dcbw@redhat.com>2018-08-08 18:38:05 +0000
commit8430b051139cc4ca5711345f6244ca5cf160c7e6 (patch)
tree1205832c93bcd209d31661025de7b8d3c5eebd0d
parentc4766122476b53a89c606bd0c0cbbd0ec6d9826b (diff)
broadband-modem: allow Enable() if disabling or initializing
The first step in the Enable() processing is to wait for a final state, so we can definitely wait for the ongoing disabling or initializing states to finish before we go on with the enable operation, there is no need to early fail if the disabling or initializing intermediate states are detected.
-rw-r--r--src/mm-broadband-modem.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 8c083566..a4be504d 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -9969,12 +9969,10 @@ enable (MMBaseModem *self,
break;
case MM_MODEM_STATE_FAILED:
- case MM_MODEM_STATE_INITIALIZING:
g_task_return_new_error (task,
MM_CORE_ERROR,
MM_CORE_ERROR_WRONG_STATE,
- "Cannot enable modem: "
- "device not fully initialized yet");
+ "Cannot enable modem: initialization failed");
break;
case MM_MODEM_STATE_LOCKED:
@@ -9984,7 +9982,9 @@ enable (MMBaseModem *self,
"Cannot enable modem: device locked");
break;
- case MM_MODEM_STATE_DISABLED: {
+ case MM_MODEM_STATE_INITIALIZING:
+ case MM_MODEM_STATE_DISABLED:
+ case MM_MODEM_STATE_DISABLING: {
EnablingContext *ctx;
ctx = g_new0 (EnablingContext, 1);
@@ -9997,14 +9997,6 @@ enable (MMBaseModem *self,
return;
}
- case MM_MODEM_STATE_DISABLING:
- g_task_return_new_error (task,
- MM_CORE_ERROR,
- MM_CORE_ERROR_WRONG_STATE,
- "Cannot enable modem: "
- "currently being disabled");
- break;
-
case MM_MODEM_STATE_ENABLING:
g_assert_not_reached ();
break;