diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2019-05-13 14:28:52 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2019-05-20 09:47:46 +0200 |
commit | da0ca28ee112e3f93c46e5b5692af6dab111a31b (patch) | |
tree | 0cdcf7574682e0ba064cf30175dc77773cfea4de | |
parent | b18cda26711b2cb76575487e1e00c429dc853417 (diff) | |
download | NetworkManager-da0ca28ee112e3f93c46e5b5692af6dab111a31b.tar.gz |
device: use variable for platform in realize_start_setup()
-rw-r--r-- | src/devices/nm-device.c | 17 |
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); } |