manager: rename suspend_source to suspend_timer

This makes its role more explicit.
This commit is contained in:
Arnaud Ferraris
2020-12-18 01:38:27 +01:00
parent 62a07f9c51
commit 067c01b685
4 changed files with 12 additions and 12 deletions

View File

@@ -126,9 +126,9 @@ void modem_reset(struct EG25Manager *manager)
if (manager->reset_timer) if (manager->reset_timer)
return; return;
if (manager->suspend_source) { if (manager->suspend_timer) {
g_source_remove(manager->suspend_source); g_source_remove(manager->suspend_timer);
manager->suspend_source = 0; manager->suspend_timer = 0;
} }
manager->modem_state = EG25_STATE_RESETTING; manager->modem_state = EG25_STATE_RESETTING;

View File

@@ -43,7 +43,7 @@ struct EG25Manager {
GDBusProxy *suspend_proxy; GDBusProxy *suspend_proxy;
int suspend_inhibit_fd; int suspend_inhibit_fd;
guint suspend_source; guint suspend_timer;
GUdevClient *udev; GUdevClient *udev;

View File

@@ -35,9 +35,9 @@ static void add_modem(struct EG25Manager *manager, GDBusObject *object)
g_assert(manager->mm_modem != NULL); g_assert(manager->mm_modem != NULL);
if (manager->modem_state == EG25_STATE_RESUMING) { if (manager->modem_state == EG25_STATE_RESUMING) {
if (manager->suspend_source) { if (manager->suspend_timer) {
g_source_remove(manager->suspend_source); g_source_remove(manager->suspend_timer);
manager->suspend_source = 0; manager->suspend_timer = 0;
} }
modem_resume_post(manager); modem_resume_post(manager);
manager->modem_state = EG25_STATE_CONFIGURED; manager->modem_state = EG25_STATE_CONFIGURED;

View File

@@ -20,7 +20,7 @@
static gboolean check_modem_resume(struct EG25Manager *manager) static gboolean check_modem_resume(struct EG25Manager *manager)
{ {
g_message("Modem wasn't probed in time, restart it!"); g_message("Modem wasn't probed in time, restart it!");
manager->suspend_source = 0; manager->suspend_timer = 0;
modem_reset(manager); modem_reset(manager);
return FALSE; return FALSE;
@@ -100,7 +100,7 @@ static void signal_cb(GDBusProxy *proxy,
take_inhibitor(manager); take_inhibitor(manager);
modem_resume_pre(manager); modem_resume_pre(manager);
manager->modem_state = EG25_STATE_RESUMING; manager->modem_state = EG25_STATE_RESUMING;
manager->suspend_source = g_timeout_add_seconds(9, G_SOURCE_FUNC(check_modem_resume), manager); manager->suspend_timer = g_timeout_add_seconds(9, G_SOURCE_FUNC(check_modem_resume), manager);
} }
} }
@@ -158,9 +158,9 @@ void suspend_init(struct EG25Manager *manager)
void suspend_destroy(struct EG25Manager *manager) void suspend_destroy(struct EG25Manager *manager)
{ {
drop_inhibitor(manager); drop_inhibitor(manager);
if (manager->suspend_source) { if (manager->suspend_timer) {
g_source_remove(manager->suspend_source); g_source_remove(manager->suspend_timer);
manager->suspend_source = 0; manager->suspend_timer = 0;
} }
if (manager->suspend_proxy) { if (manager->suspend_proxy) {
g_object_unref(manager->suspend_proxy); g_object_unref(manager->suspend_proxy);