[PATCH 02/15] modem-manager: remove the `device' property from `NMModem'



This property is not really used anywhere; so pointless to have it around.

Also, we already make sure in `NMModemManager' that the so called 'master'
device is valid and exists.
---
 src/modem-manager/nm-modem-cdma.c    |  3 ---
 src/modem-manager/nm-modem-cdma.h    |  1 -
 src/modem-manager/nm-modem-gsm.c     |  3 ---
 src/modem-manager/nm-modem-gsm.h     |  1 -
 src/modem-manager/nm-modem-manager.c |  4 ++--
 src/modem-manager/nm-modem.c         | 25 +------------------------
 src/modem-manager/nm-modem.h         |  1 -
 7 files changed, 3 insertions(+), 35 deletions(-)

diff --git a/src/modem-manager/nm-modem-cdma.c b/src/modem-manager/nm-modem-cdma.c
index b02c193..48176c6 100644
--- a/src/modem-manager/nm-modem-cdma.c
+++ b/src/modem-manager/nm-modem-cdma.c
@@ -62,18 +62,15 @@ nm_cdma_error_quark (void)
 
 NMModem *
 nm_modem_cdma_new (const char *path,
-                   const char *device,
                    const char *data_device,
                    guint32 ip_method,
                    NMModemState state)
 {
 	g_return_val_if_fail (path != NULL, NULL);
-	g_return_val_if_fail (device != NULL, NULL);
 	g_return_val_if_fail (data_device != NULL, NULL);
 
 	return (NMModem *) g_object_new (NM_TYPE_MODEM_CDMA,
 	                                 NM_MODEM_PATH, path,
-	                                 NM_MODEM_DEVICE, device,
 	                                 NM_MODEM_IFACE, data_device,
 	                                 NM_MODEM_IP_METHOD, ip_method,
 	                                 NM_MODEM_STATE, state,
diff --git a/src/modem-manager/nm-modem-cdma.h b/src/modem-manager/nm-modem-cdma.h
index 50d0cb2..53742da 100644
--- a/src/modem-manager/nm-modem-cdma.h
+++ b/src/modem-manager/nm-modem-cdma.h
@@ -53,7 +53,6 @@ typedef struct {
 GType nm_modem_cdma_get_type (void);
 
 NMModem *nm_modem_cdma_new (const char *path,
-                            const char *device,
                             const char *data_device,
                             guint32 ip_method,
                             NMModemState state);
diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c
index feef908..54bbe3c 100644
--- a/src/modem-manager/nm-modem-gsm.c
+++ b/src/modem-manager/nm-modem-gsm.c
@@ -104,18 +104,15 @@ nm_gsm_error_quark (void)
 
 NMModem *
 nm_modem_gsm_new (const char *path,
-                  const char *device,
                   const char *data_device,
                   guint32 ip_method,
                   NMModemState state)
 {
 	g_return_val_if_fail (path != NULL, NULL);
-	g_return_val_if_fail (device != NULL, NULL);
 	g_return_val_if_fail (data_device != NULL, NULL);
 
 	return (NMModem *) g_object_new (NM_TYPE_MODEM_GSM,
 	                                 NM_MODEM_PATH, path,
-	                                 NM_MODEM_DEVICE, device,
 	                                 NM_MODEM_IFACE, data_device,
 	                                 NM_MODEM_IP_METHOD, ip_method,
 	                                 NM_MODEM_STATE, state,
diff --git a/src/modem-manager/nm-modem-gsm.h b/src/modem-manager/nm-modem-gsm.h
index 3846405..a8a9489 100644
--- a/src/modem-manager/nm-modem-gsm.h
+++ b/src/modem-manager/nm-modem-gsm.h
@@ -53,7 +53,6 @@ typedef struct {
 GType nm_modem_gsm_get_type (void);
 
 NMModem *nm_modem_gsm_new (const char *path,
-                           const char *device,
                            const char *data_device,
                            guint32 ip_method,
                            NMModemState state);
diff --git a/src/modem-manager/nm-modem-manager.c b/src/modem-manager/nm-modem-manager.c
index 11614b8..86bb805 100644
--- a/src/modem-manager/nm-modem-manager.c
+++ b/src/modem-manager/nm-modem-manager.c
@@ -176,9 +176,9 @@ create_modem (NMModemManager *manager, const char *path)
 	}
 
 	if (modem_type == MM_MODEM_TYPE_GSM)
-		modem = nm_modem_gsm_new (path, master_device, data_device, ip_method, state);
+		modem = nm_modem_gsm_new (path, data_device, ip_method, state);
 	else if (modem_type == MM_MODEM_TYPE_CDMA)
-		modem = nm_modem_cdma_new (path, master_device, data_device, ip_method, state);
+		modem = nm_modem_cdma_new (path, data_device, ip_method, state);
 	else
 		nm_log_warn (LOGD_MB, "unknown modem type '%d'", modem_type);
 
diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c
index e9f3092..76567a8 100644
--- a/src/modem-manager/nm-modem.c
+++ b/src/modem-manager/nm-modem.c
@@ -38,7 +38,6 @@ G_DEFINE_TYPE (NMModem, nm_modem, G_TYPE_OBJECT)
 
 enum {
 	PROP_0,
-	PROP_DEVICE,
 	PROP_IFACE,
 	PROP_PATH,
 	PROP_IP_METHOD,
@@ -51,7 +50,6 @@ enum {
 
 typedef struct {
 	char *path;
-	char *device;
 	char *iface;
 	guint32 ip_method;
 
@@ -656,12 +654,7 @@ constructor (GType type,
 
 	priv = NM_MODEM_GET_PRIVATE (object);
 
-	if (!priv->device) {
-		nm_log_err (LOGD_HW, "modem parent device not provided");
-		goto err;
-	}
-
-	if (!priv->device) {
+	if (!priv->iface) {
 		nm_log_err (LOGD_HW, "modem command interface not provided");
 		goto err;
 	}
@@ -688,9 +681,6 @@ get_property (GObject *object, guint prop_id,
 	case PROP_PATH:
 		g_value_set_string (value, priv->path);
 		break;
-	case PROP_DEVICE:
-		g_value_set_string (value, priv->device);
-		break;
 	case PROP_IFACE:
 		g_value_set_string (value, priv->iface);
 		break;
@@ -723,10 +713,6 @@ set_property (GObject *object, guint prop_id,
 		/* Construct only */
 		priv->path = g_value_dup_string (value);
 		break;
-	case PROP_DEVICE:
-		/* Construct only */
-		priv->device = g_value_dup_string (value);
-		break;
 	case PROP_IFACE:
 		/* Construct only */
 		priv->iface = g_value_dup_string (value);
@@ -770,7 +756,6 @@ finalize (GObject *object)
 
 	g_free (priv->iface);
 	g_free (priv->path);
-	g_free (priv->device);
 
 	G_OBJECT_CLASS (nm_modem_parent_class)->finalize (object);
 }
@@ -803,14 +788,6 @@ nm_modem_class_init (NMModemClass *klass)
 							  G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
 	g_object_class_install_property
-		(object_class, PROP_DEVICE,
-		 g_param_spec_string (NM_MODEM_DEVICE,
-		                      "Device",
-		                      "Master modem parent device",
-		                      NULL,
-		                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-	g_object_class_install_property
 		(object_class, PROP_IFACE,
 		 g_param_spec_string (NM_MODEM_IFACE,
 		                      "Interface",
diff --git a/src/modem-manager/nm-modem.h b/src/modem-manager/nm-modem.h
index 1b6c6d8..91eec95 100644
--- a/src/modem-manager/nm-modem.h
+++ b/src/modem-manager/nm-modem.h
@@ -37,7 +37,6 @@ G_BEGIN_DECLS
 #define NM_MODEM_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj),	NM_TYPE_MODEM, NMModemClass))
 
 #define NM_MODEM_PATH      "path"
-#define NM_MODEM_DEVICE    "device"
 #define NM_MODEM_IFACE     "iface"
 #define NM_MODEM_IP_METHOD "ip-method"
 #define NM_MODEM_IP_TIMEOUT "ip-timeout"
-- 
1.7.11.7



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]