broadband-modem: remove unneeded InitializationStartedContext struct
This commit is contained in:
@@ -8561,17 +8561,6 @@ initialization_stopped (MMBroadbandModem *self,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
PortsContext *ports;
|
||||
} InitializationStartedContext;
|
||||
|
||||
static void
|
||||
initialization_started_context_free (InitializationStartedContext *ctx)
|
||||
{
|
||||
ports_context_unref (ctx->ports);
|
||||
g_free (ctx);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
initialization_started_finish (MMBroadbandModem *self,
|
||||
GAsyncResult *res,
|
||||
@@ -8625,24 +8614,20 @@ initialization_started (MMBroadbandModem *self,
|
||||
gpointer user_data)
|
||||
{
|
||||
GError *error = NULL;
|
||||
InitializationStartedContext *ctx;
|
||||
GTask *task;
|
||||
|
||||
ctx = g_new0 (InitializationStartedContext, 1);
|
||||
ctx->ports = g_new0 (PortsContext, 1);
|
||||
ctx->ports->ref_count = 1;
|
||||
PortsContext *ctx;
|
||||
|
||||
task = g_task_new (self, NULL, callback, user_data);
|
||||
g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_started_context_free);
|
||||
|
||||
if (!open_ports_initialization (self, ctx->ports, &error)) {
|
||||
ctx = g_new0 (PortsContext, 1);
|
||||
ctx->ref_count = 1;
|
||||
|
||||
if (!open_ports_initialization (self, ctx, &error)) {
|
||||
ports_context_unref (ctx);
|
||||
g_prefix_error (&error, "Couldn't open ports during modem initialization: ");
|
||||
g_task_return_error (task, error);
|
||||
} else
|
||||
g_task_return_pointer (task,
|
||||
ports_context_ref (ctx->ports),
|
||||
(GDestroyNotify)ports_context_unref);
|
||||
|
||||
g_task_return_pointer (task, ctx, (GDestroyNotify)ports_context_unref);
|
||||
g_object_unref (task);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user