diff options
author | Dan Williams <dan@ioncontrol.co> | 2025-03-19 07:43:15 -0500 |
---|---|---|
committer | Dan Williams <dan@ioncontrol.co> | 2025-05-07 22:59:51 -0500 |
commit | e0c0c686887c7e3c12ae3a16fbbddbcfe58df632 (patch) | |
tree | bb0014fd03de716e8f68e1a55d271f931396d317 | |
parent | f4cbca56d5cea3ac865e6f113712752a98df2509 (diff) |
base-manager,device: consolidate modem cancelling into mm_device_remove_modem()
Every use of mm_device_remove_modem() was already trying to cancel the
modem's canellable, so let's just put it there and simplify the callers.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
-rw-r--r-- | src/mm-base-manager.c | 9 | ||||
-rw-r--r-- | src/mm-device.c | 2 |
2 files changed, 1 insertions, 10 deletions
diff --git a/src/mm-base-manager.c b/src/mm-base-manager.c index 6de8d50a..c6cd3adb 100644 --- a/src/mm-base-manager.c +++ b/src/mm-base-manager.c @@ -513,7 +513,6 @@ additional_port (MMBaseManager *self, } mm_obj_info (self, "last modem object creation in device '%s' succeeded, but we have a new port addition, will retry", uid); - g_cancellable_cancel (mm_base_modem_peek_cancellable (modem)); mm_device_remove_modem (device, (GAsyncReadyCallback)additional_port_modem_remove_ready, g_object_ref (self)); @@ -960,8 +959,6 @@ shutdown_remove_device (MMDevice *device, if (device) { mm_obj_dbg (ctx->self, "removing modem device %s", mm_device_get_uid (device)); - if (modem) - g_cancellable_cancel (mm_base_modem_peek_cancellable (modem)); mm_device_remove_modem (g_object_ref (device), /* keep alive over removal */ (GAsyncReadyCallback)modem_remove_ready, ctx); @@ -1044,12 +1041,6 @@ foreach_remove (gpointer key, MMDevice *device, ShutdownContext *ctx) { - MMBaseModem *modem; - - modem = mm_device_peek_modem (device); - if (modem) - g_cancellable_cancel (mm_base_modem_peek_cancellable (modem)); - shutdown_context_ref (ctx); shutdown_remove_device (device, NULL, ctx); return TRUE; diff --git a/src/mm-device.c b/src/mm-device.c index 32849e25..96b7d874 100644 --- a/src/mm-device.c +++ b/src/mm-device.c @@ -503,6 +503,7 @@ mm_device_remove_modem (MMDevice *self, } unexport_modem (self); + g_cancellable_cancel (mm_base_modem_peek_cancellable (self->priv->modem)); mm_base_modem_teardown_ports (self->priv->modem, (GAsyncReadyCallback)teardown_ports_ready, task); @@ -831,7 +832,6 @@ inhibit_disable_ready (MMBaseModem *modem, return; } - g_cancellable_cancel (mm_base_modem_peek_cancellable (modem)); mm_device_remove_modem (self, (GAsyncReadyCallback)inhibit_disable_modem_remove_ready, task); |