aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/telit/mm-broadband-modem-mbim-telit.c6
-rw-r--r--src/plugins/telit/mm-broadband-modem-telit.c4
-rw-r--r--src/plugins/telit/mm-shared-telit.c27
-rw-r--r--src/plugins/telit/mm-shared-telit.h12
4 files changed, 13 insertions, 36 deletions
diff --git a/src/plugins/telit/mm-broadband-modem-mbim-telit.c b/src/plugins/telit/mm-broadband-modem-mbim-telit.c
index 0f0c6c34..0c4d7e2e 100644
--- a/src/plugins/telit/mm-broadband-modem-mbim-telit.c
+++ b/src/plugins/telit/mm-broadband-modem-mbim-telit.c
@@ -30,8 +30,8 @@
#include "mm-modem-helpers-telit.h"
#include "mm-shared-telit.h"
-static void iface_modem_init (MMIfaceModemInterface *iface);
-static void shared_telit_init (MMSharedTelit *iface);
+static void iface_modem_init (MMIfaceModemInterface *iface);
+static void shared_telit_init (MMSharedTelitInterface *iface);
static MMIfaceModemInterface *iface_modem_parent;
@@ -258,7 +258,7 @@ peek_parent_modem_interface (MMSharedTelit *self)
}
static void
-shared_telit_init (MMSharedTelit *iface)
+shared_telit_init (MMSharedTelitInterface *iface)
{
iface->peek_parent_modem_interface = peek_parent_modem_interface;
}
diff --git a/src/plugins/telit/mm-broadband-modem-telit.c b/src/plugins/telit/mm-broadband-modem-telit.c
index 105bf177..1d1185f4 100644
--- a/src/plugins/telit/mm-broadband-modem-telit.c
+++ b/src/plugins/telit/mm-broadband-modem-telit.c
@@ -38,7 +38,7 @@
static void iface_modem_init (MMIfaceModemInterface *iface);
static void iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface);
-static void shared_telit_init (MMSharedTelit *iface);
+static void shared_telit_init (MMSharedTelitInterface *iface);
static void iface_modem_location_init (MMIfaceModemLocationInterface *iface);
static MMIfaceModemInterface *iface_modem_parent;
@@ -1592,7 +1592,7 @@ iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface)
}
static void
-shared_telit_init (MMSharedTelit *iface)
+shared_telit_init (MMSharedTelitInterface *iface)
{
}
diff --git a/src/plugins/telit/mm-shared-telit.c b/src/plugins/telit/mm-shared-telit.c
index 9fdcc62e..15d4b26c 100644
--- a/src/plugins/telit/mm-shared-telit.c
+++ b/src/plugins/telit/mm-shared-telit.c
@@ -31,6 +31,8 @@
#include "mm-modem-helpers-telit.h"
#include "mm-shared-telit.h"
+G_DEFINE_INTERFACE (MMSharedTelit, mm_shared_telit, MM_TYPE_IFACE_MODEM)
+
/*****************************************************************************/
/* Private data context */
@@ -113,8 +115,8 @@ get_private (MMSharedTelit *self)
if (!priv) {
priv = g_slice_new0 (Private);
- if (MM_SHARED_TELIT_GET_INTERFACE (self)->peek_parent_modem_interface)
- priv->iface_modem_parent = MM_SHARED_TELIT_GET_INTERFACE (self)->peek_parent_modem_interface (self);
+ if (MM_SHARED_TELIT_GET_IFACE (self)->peek_parent_modem_interface)
+ priv->iface_modem_parent = MM_SHARED_TELIT_GET_IFACE (self)->peek_parent_modem_interface (self);
g_object_set_qdata_full (G_OBJECT (self), private_quark, priv, (GDestroyNotify)private_free);
}
@@ -792,25 +794,6 @@ mm_shared_telit_modem_load_revision (MMIfaceModem *self,
/*****************************************************************************/
static void
-shared_telit_init (gpointer g_iface)
-{
-}
-
-GType
-mm_shared_telit_get_type (void)
+mm_shared_telit_default_init (MMSharedTelitInterface *iface)
{
- static GType shared_telit_type = 0;
-
- if (!G_UNLIKELY (shared_telit_type)) {
- static const GTypeInfo info = {
- sizeof (MMSharedTelit), /* class_size */
- shared_telit_init, /* base_init */
- NULL, /* base_finalize */
- };
-
- shared_telit_type = g_type_register_static (G_TYPE_INTERFACE, "MMSharedTelit", &info, 0);
- g_type_interface_add_prerequisite (shared_telit_type, MM_TYPE_IFACE_MODEM);
- }
-
- return shared_telit_type;
}
diff --git a/src/plugins/telit/mm-shared-telit.h b/src/plugins/telit/mm-shared-telit.h
index 911b4cd9..224ea466 100644
--- a/src/plugins/telit/mm-shared-telit.h
+++ b/src/plugins/telit/mm-shared-telit.h
@@ -27,22 +27,16 @@
#include "mm-iface-modem-location.h"
#include "mm-modem-helpers-telit.h"
-#define MM_TYPE_SHARED_TELIT (mm_shared_telit_get_type ())
-#define MM_SHARED_TELIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SHARED_TELIT, MMSharedTelit))
-#define MM_IS_SHARED_TELIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SHARED_TELIT))
-#define MM_SHARED_TELIT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_SHARED_TELIT, MMSharedTelit))
+#define MM_TYPE_SHARED_TELIT mm_shared_telit_get_type ()
+G_DECLARE_INTERFACE (MMSharedTelit, mm_shared_telit, MM, SHARED_TELIT, MMIfaceModem)
-typedef struct _MMSharedTelit MMSharedTelit;
-
-struct _MMSharedTelit {
+struct _MMSharedTelitInterface {
GTypeInterface g_iface;
/* Peek modem interface of the parent class of the object */
MMIfaceModemInterface * (* peek_parent_modem_interface) (MMSharedTelit *self);
};
-GType mm_shared_telit_get_type (void);
-
void mm_shared_telit_store_supported_modes (MMSharedTelit *self,
GArray *modes);