mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-22 01:10:44 +02:00
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.
This commit is contained in:
parent
1eca1b2648
commit
f98ef0fdc4
7 changed files with 3 additions and 35 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -802,14 +787,6 @@ nm_modem_class_init (NMModemClass *klass)
|
|||
NULL,
|
||||
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,
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue