diff --git a/src/suspend.c b/src/suspend.c index 4bace47..190d48d 100644 --- a/src/suspend.c +++ b/src/suspend.c @@ -18,11 +18,22 @@ #define SD_PATH "/org/freedesktop/login1" #define SD_INTERFACE "org.freedesktop.login1.Manager" +static void resume_ok(struct EG25Manager *manager) +{ + manager->modem_state = EG25_STATE_CONFIGURED; + modem_resume_post(manager); +} + static gboolean check_modem_resume(struct EG25Manager *manager) { - g_message("Modem wasn't probed in time, restart it!"); manager->modem_recovery_timer = 0; - modem_reset(manager); + + if (manager->mm_modem) { + resume_ok(manager); + } else { + g_message("Modem wasn't probed in time, restart it!"); + modem_reset(manager); + } return FALSE; } @@ -184,8 +195,7 @@ static void signal_cb(GDBusProxy *proxy, * If modem is managed by ofono, we also do resume sequence immediately * as ofono handles resuming from sleep itself. */ - manager->modem_state = EG25_STATE_CONFIGURED; - modem_resume_post(manager); + resume_ok(manager); } else { manager->modem_state = EG25_STATE_RESUMING; manager->modem_recovery_timer = g_timeout_add_seconds(manager->modem_recovery_timeout,