From 067c01b685b40cfe34776e653aeaf8d32052b7f6 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Fri, 18 Dec 2020 01:38:27 +0100 Subject: [PATCH] manager: rename suspend_source to suspend_timer This makes its role more explicit. --- src/manager.c | 6 +++--- src/manager.h | 2 +- src/mm-iface.c | 6 +++--- src/suspend.c | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/manager.c b/src/manager.c index a7dc2ff..bc08ddb 100644 --- a/src/manager.c +++ b/src/manager.c @@ -126,9 +126,9 @@ void modem_reset(struct EG25Manager *manager) if (manager->reset_timer) return; - if (manager->suspend_source) { - g_source_remove(manager->suspend_source); - manager->suspend_source = 0; + if (manager->suspend_timer) { + g_source_remove(manager->suspend_timer); + manager->suspend_timer = 0; } manager->modem_state = EG25_STATE_RESETTING; diff --git a/src/manager.h b/src/manager.h index feaca9b..c51f32f 100644 --- a/src/manager.h +++ b/src/manager.h @@ -43,7 +43,7 @@ struct EG25Manager { GDBusProxy *suspend_proxy; int suspend_inhibit_fd; - guint suspend_source; + guint suspend_timer; GUdevClient *udev; diff --git a/src/mm-iface.c b/src/mm-iface.c index 76c5138..21f2f8d 100644 --- a/src/mm-iface.c +++ b/src/mm-iface.c @@ -35,9 +35,9 @@ static void add_modem(struct EG25Manager *manager, GDBusObject *object) g_assert(manager->mm_modem != NULL); if (manager->modem_state == EG25_STATE_RESUMING) { - if (manager->suspend_source) { - g_source_remove(manager->suspend_source); - manager->suspend_source = 0; + if (manager->suspend_timer) { + g_source_remove(manager->suspend_timer); + manager->suspend_timer = 0; } modem_resume_post(manager); manager->modem_state = EG25_STATE_CONFIGURED; diff --git a/src/suspend.c b/src/suspend.c index 92260a9..2e1301e 100644 --- a/src/suspend.c +++ b/src/suspend.c @@ -20,7 +20,7 @@ static gboolean check_modem_resume(struct EG25Manager *manager) { g_message("Modem wasn't probed in time, restart it!"); - manager->suspend_source = 0; + manager->suspend_timer = 0; modem_reset(manager); return FALSE; @@ -100,7 +100,7 @@ static void signal_cb(GDBusProxy *proxy, take_inhibitor(manager); modem_resume_pre(manager); 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) { drop_inhibitor(manager); - if (manager->suspend_source) { - g_source_remove(manager->suspend_source); - manager->suspend_source = 0; + if (manager->suspend_timer) { + g_source_remove(manager->suspend_timer); + manager->suspend_timer = 0; } if (manager->suspend_proxy) { g_object_unref(manager->suspend_proxy);