summaryrefslogtreecommitdiff
path: root/libnm/nm-device.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-10-12 19:49:46 +0200
committerThomas Haller <thaller@redhat.com>2016-10-24 10:14:02 +0200
commit21d7aa92044b458028e1968cd09ec015edf977ec (patch)
tree8919c0af4e3187a344eeb2aeb51e66becbcf2629 /libnm/nm-device.c
parentc4198d45e3cd4b3896a80db6cd0ec2cd161aa28f (diff)
downloadNetworkManager-21d7aa92044b458028e1968cd09ec015edf977ec.tar.gz
libnm: minor refactoring by using g_clear_object() and nm_str_not_empty()
Diffstat (limited to 'libnm/nm-device.c')
-rw-r--r--libnm/nm-device.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/libnm/nm-device.c b/libnm/nm-device.c
index b3dc01b20f..58d0f5fbc7 100644
--- a/libnm/nm-device.c
+++ b/libnm/nm-device.c
@@ -2084,16 +2084,9 @@ done:
const char *
nm_device_get_physical_port_id (NMDevice *device)
{
- NMDevicePrivate *priv;
-
g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
- priv = NM_DEVICE_GET_PRIVATE (device);
-
- if (priv->physical_port_id && *priv->physical_port_id)
- return priv->physical_port_id;
- else
- return NULL;
+ return nm_str_not_empty (NM_DEVICE_GET_PRIVATE (device)->physical_port_id);
}
/**