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.
This commit is contained in:
committed by
Dan Williams
parent
c476612247
commit
8430b05113
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user