device: remove function nm_device_is_enslaved()

There were only two callers. Let them access the field
directly.
This commit is contained in:
Thomas Haller 2017-05-14 09:45:53 +02:00
parent 019d3adbca
commit f4de6734a9
2 changed files with 2 additions and 17 deletions

View file

@ -91,8 +91,6 @@ gboolean nm_device_dhcp6_renew (NMDevice *device, gboolean release);
void nm_device_recheck_available_connections (NMDevice *device);
gboolean nm_device_get_enslaved (NMDevice *device);
void nm_device_master_check_slave_physical_port (NMDevice *self, NMDevice *slave,
NMLogDomain log_domain);

View file

@ -2198,7 +2198,7 @@ carrier_changed (NMDevice *self, gboolean carrier)
nm_device_activate_stage3_ip6_start (self);
return;
} else if (nm_device_get_enslaved (self) && !carrier) {
} else if (priv->is_enslaved && !carrier) {
/* Slaves don't deactivate when they lose carrier; for
* bonds/teams in particular that would be actively
* counterproductive.
@ -3653,19 +3653,6 @@ nm_device_slave_notify_release (NMDevice *self, NMDeviceStateReason reason)
}
}
/**
* nm_device_get_enslaved:
* @self: the #NMDevice
*
* Returns: %TRUE if the device is enslaved to a master device (eg bridge or
* bond or team), %FALSE if not
*/
gboolean
nm_device_get_enslaved (NMDevice *self)
{
return NM_DEVICE_GET_PRIVATE (self)->is_enslaved;
}
/**
* nm_device_removed:
* @self: the #NMDevice
@ -6009,7 +5996,7 @@ have_any_ready_slaves (NMDevice *self, const GSList *slaves)
* properties set up.
*/
for (iter = slaves; iter; iter = g_slist_next (iter)) {
if (nm_device_get_enslaved (iter->data))
if (NM_DEVICE_GET_PRIVATE (NM_DEVICE (iter->data))->is_enslaved)
return TRUE;
}
return FALSE;