summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-05-13 14:28:52 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2019-05-20 13:57:35 +0200
commit831f079e55590b03b8b980290b8ddddf28feba66 (patch)
tree9de81a8ba594e04764c3f6782d3304c6fb29b67d
parentff2d0f5add91bc1e614ef6ea2fc2a581ff640452 (diff)
downloadNetworkManager-831f079e55590b03b8b980290b8ddddf28feba66.tar.gz
device: use variable for platform in realize_start_setup()
-rw-r--r--src/devices/nm-device.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 38582937e4..7757d18cab 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -4260,6 +4260,7 @@ realize_start_setup (NMDevice *self,
{
NMDevicePrivate *priv;
NMDeviceClass *klass;
+ NMPlatform *platform;
static guint32 id = 0;
NMDeviceCapabilities capabilities = 0;
NMConfig *config;
@@ -4284,6 +4285,7 @@ realize_start_setup (NMDevice *self,
_LOGD (LOGD_DEVICE, "start setup of %s, kernel ifindex %d", G_OBJECT_TYPE_NAME (self), plink ? plink->ifindex : 0);
klass = NM_DEVICE_GET_CLASS (self);
+ platform = nm_device_get_platform (self);
/* Balanced by a thaw in nm_device_realize_finish() */
g_object_freeze_notify (G_OBJECT (self));
@@ -4302,19 +4304,19 @@ realize_start_setup (NMDevice *self,
nm_device_update_from_platform_link (self, plink);
if (priv->ifindex > 0) {
- priv->physical_port_id = nm_platform_link_get_physical_port_id (nm_device_get_platform (self), priv->ifindex);
+ priv->physical_port_id = nm_platform_link_get_physical_port_id (platform, priv->ifindex);
_notify (self, PROP_PHYSICAL_PORT_ID);
- priv->dev_id = nm_platform_link_get_dev_id (nm_device_get_platform (self), priv->ifindex);
+ priv->dev_id = nm_platform_link_get_dev_id (platform, priv->ifindex);
- if (nm_platform_link_is_software (nm_device_get_platform (self), priv->ifindex))
+ if (nm_platform_link_is_software (platform, priv->ifindex))
capabilities |= NM_DEVICE_CAP_IS_SOFTWARE;
_set_mtu (self,
- nm_platform_link_get_mtu (nm_device_get_platform (self),
+ nm_platform_link_get_mtu (platform,
priv->ifindex));
- nm_platform_link_get_driver_info (nm_device_get_platform (self),
+ nm_platform_link_get_driver_info (platform,
priv->ifindex,
NULL,
&priv->driver_version,
@@ -4325,9 +4327,9 @@ realize_start_setup (NMDevice *self,
_notify (self, PROP_FIRMWARE_VERSION);
if (nm_platform_kernel_support_get (NM_PLATFORM_KERNEL_SUPPORT_TYPE_USER_IPV6LL))
- priv->ipv6ll_handle = nm_platform_link_get_user_ipv6ll_enabled (nm_device_get_platform (self), priv->ifindex);
+ priv->ipv6ll_handle = nm_platform_link_get_user_ipv6ll_enabled (platform, priv->ifindex);
- if (nm_platform_link_supports_sriov (nm_device_get_platform (self), priv->ifindex))
+ if (nm_platform_link_supports_sriov (platform, priv->ifindex))
capabilities |= NM_DEVICE_CAP_SRIOV;
}
@@ -4393,6 +4395,7 @@ realize_start_setup (NMDevice *self,
nm_device_set_unmanaged_by_user_udev (self);
nm_device_set_unmanaged_by_user_conf (self);
+
nm_device_set_unmanaged_flags (self, NM_UNMANAGED_PLATFORM_INIT,
plink && !plink->initialized);
}