aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-cdma.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-08 12:47:45 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-16 14:53:23 +0100
commitcc6d4a97fb0a11c799f1079c6db86b31db7eadf7 (patch)
treea1b6214fdc960285dcb020f45b132db2598fd3c1 /src/mm-iface-modem-cdma.c
parent48285dcfdf04becbe90922ac3f2dd942bc43de53 (diff)
base-modem: new port getters and peekers
* mm_base_modem_peek_port_* () will return either a port object (no new reference), or NULL if none available. You would usually peek() a port if you're going to use it just in the current method, as there is no way to that reference to get invalid (we're single threaded). * mm_base_modem_get_port_* () will return either NEW references to valid port objects, or NULL if none available. And, you would usually get() a port, whenever you want the port object to be valid even out of the current method, for example when keeping it in the context of an async operation. Also, we need to consider that the primary AT port MAY BE NULL when you peek() or get() it. This is due to the fact that we may be releasing ports (due to device disconnection) in the middle of async operations.
Diffstat (limited to 'src/mm-iface-modem-cdma.c')
-rw-r--r--src/mm-iface-modem-cdma.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/mm-iface-modem-cdma.c b/src/mm-iface-modem-cdma.c
index c5983ddf..ec5d27e6 100644
--- a/src/mm-iface-modem-cdma.c
+++ b/src/mm-iface-modem-cdma.c
@@ -1101,7 +1101,6 @@ typedef enum {
struct _DisablingContext {
MMIfaceModemCdma *self;
- MMAtSerialPort *primary;
DisablingStep step;
GSimpleAsyncResult *result;
MmGdbusModemCdma *skeleton;
@@ -1116,7 +1115,6 @@ disabling_context_new (MMIfaceModemCdma *self,
ctx = g_new0 (DisablingContext, 1);
ctx->self = g_object_ref (self);
- ctx->primary = g_object_ref (mm_base_modem_get_port_primary (MM_BASE_MODEM (self)));
ctx->result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
@@ -1135,7 +1133,6 @@ disabling_context_complete_and_free (DisablingContext *ctx)
{
g_simple_async_result_complete_in_idle (ctx->result);
g_object_unref (ctx->self);
- g_object_unref (ctx->primary);
g_object_unref (ctx->result);
g_object_unref (ctx->skeleton);
g_free (ctx);
@@ -1196,7 +1193,6 @@ typedef enum {
struct _EnablingContext {
MMIfaceModemCdma *self;
- MMAtSerialPort *primary;
EnablingStep step;
GSimpleAsyncResult *result;
MmGdbusModemCdma *skeleton;
@@ -1211,7 +1207,6 @@ enabling_context_new (MMIfaceModemCdma *self,
ctx = g_new0 (EnablingContext, 1);
ctx->self = g_object_ref (self);
- ctx->primary = g_object_ref (mm_base_modem_get_port_primary (MM_BASE_MODEM (self)));
ctx->result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
@@ -1230,7 +1225,6 @@ enabling_context_complete_and_free (EnablingContext *ctx)
{
g_simple_async_result_complete_in_idle (ctx->result);
g_object_unref (ctx->self);
- g_object_unref (ctx->primary);
g_object_unref (ctx->result);
g_object_unref (ctx->skeleton);
g_free (ctx);