modem-manager: Set the context when the device is constructed

This commit is contained in:
Richard Hughes 2021-12-13 20:24:20 +00:00 committed by Mario Limonciello
parent ec5d35ca8c
commit e21fb7630a
3 changed files with 4 additions and 4 deletions

View File

@ -1552,9 +1552,9 @@ fu_mm_device_class_init(FuMmDeviceClass *klass)
}
FuMmDevice *
fu_mm_device_new(MMManager *manager, MMObject *omodem)
fu_mm_device_new(FuContext *ctx, MMManager *manager, MMObject *omodem)
{
FuMmDevice *self = g_object_new(FU_TYPE_MM_DEVICE, NULL);
FuMmDevice *self = g_object_new(FU_TYPE_MM_DEVICE, "context", ctx, NULL);
self->manager = g_object_ref(manager);
self->omodem = g_object_ref(omodem);
self->port_at_ifnum = -1;

View File

@ -16,7 +16,7 @@
G_DECLARE_FINAL_TYPE(FuMmDevice, fu_mm_device, FU, MM_DEVICE, FuDevice)
FuMmDevice *
fu_mm_device_new(MMManager *manager, MMObject *omodem);
fu_mm_device_new(FuContext *ctx, MMManager *manager, MMObject *omodem);
const gchar *
fu_mm_device_get_inhibition_uid(FuMmDevice *device);
const gchar *

View File

@ -223,7 +223,7 @@ fu_plugin_mm_device_add(FuPlugin *plugin, MMObject *modem)
g_warning("MM device already added, ignoring");
return;
}
dev = fu_mm_device_new(priv->manager, modem);
dev = fu_mm_device_new(fu_plugin_get_context(plugin), priv->manager, modem);
if (!fu_device_setup(FU_DEVICE(dev), &error)) {
g_warning("failed to probe MM device: %s", error->message);
return;