diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-10-23 17:57:12 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-10-26 14:55:15 +0200 |
commit | 64b1cc0f1d11b370e8c9e2cd07d24bf63fd61d07 (patch) | |
tree | a8ff236d17be090c85a4883bab88bad3b74573eb /src/linux/up-device-supply.c | |
parent | f62e7f11a7d9f89abb7b3b971417337a239e5ba6 (diff) | |
download | upower-64b1cc0f1d11b370e8c9e2cd07d24bf63fd61d07.tar.gz |
linux: Split up battery and device refresh
In up_device_supply_refresh().
Diffstat (limited to 'src/linux/up-device-supply.c')
-rw-r--r-- | src/linux/up-device-supply.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c index 32001dc..5fb7cb0 100644 --- a/src/linux/up-device-supply.c +++ b/src/linux/up-device-supply.c @@ -1106,18 +1106,18 @@ up_device_supply_refresh (UpDevice *device) case UP_DEVICE_KIND_LINE_POWER: ret = up_device_supply_refresh_line_power (supply); break; - default: + case UP_DEVICE_KIND_BATTERY: up_device_supply_disable_poll (device); - - if (supply->priv->is_power_supply) - ret = up_device_supply_refresh_battery (supply, &state); - else - ret = up_device_supply_refresh_device (supply, &state); - + ret = up_device_supply_refresh_battery (supply, &state); /* Seems that we don't get change uevents from the * kernel on some BIOS types */ up_device_supply_setup_poll (device, state); break; + default: + up_device_supply_disable_poll (device); + ret = up_device_supply_refresh_device (supply, &state); + up_device_supply_setup_poll (device, state); + break; } /* reset time if we got new data */ |