summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2017-01-24 13:04:39 +0100
committerBastien Nocera <hadess@hadess.net>2017-01-24 17:45:58 +0100
commit140b18f8f4302abc8db8f9cfc04796dd71bd5f64 (patch)
treea911b42cfbee7616a915a64eb20b6f54adc0daf4
parent5b217179be87fc81d2e99a6c62c9759e55dd6230 (diff)
downloadupower-140b18f8f4302abc8db8f9cfc04796dd71bd5f64.tar.gz
linux: Remove unneeded goto
-rw-r--r--src/linux/up-device-supply.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c
index 3f90bf3..8125d9d 100644
--- a/src/linux/up-device-supply.c
+++ b/src/linux/up-device-supply.c
@@ -1007,7 +1007,6 @@ static gboolean
up_device_supply_coldplug (UpDevice *device)
{
UpDeviceSupply *supply = UP_DEVICE_SUPPLY (device);
- gboolean ret = FALSE;
GUdevDevice *native;
const gchar *native_path;
const gchar *scope;
@@ -1020,7 +1019,7 @@ up_device_supply_coldplug (UpDevice *device)
native_path = g_udev_device_get_sysfs_path (native);
if (native_path == NULL) {
g_warning ("could not get native path for %p", device);
- goto out;
+ return FALSE;
}
/* try to work out if the device is powering the system */
@@ -1038,7 +1037,7 @@ up_device_supply_coldplug (UpDevice *device)
if (supply->priv->is_power_supply == FALSE &&
!sysfs_file_exists (native_path, "capacity")) {
g_debug ("Ignoring device AC, we'll monitor the device battery");
- goto out;
+ return FALSE;
}
/* try to detect using the device type */
@@ -1065,9 +1064,7 @@ up_device_supply_coldplug (UpDevice *device)
up_daemon_start_poll (G_OBJECT (device), (GSourceFunc) up_device_supply_refresh);
/* coldplug values */
- ret = up_device_supply_refresh (device);
-out:
- return ret;
+ return up_device_supply_refresh (device);
}
/**