main_battery = NULL;
bp.main = main_battery;
- error = class_for_each_device(power_supply_class, &bp,
+ error = class_for_each_device(power_supply_class, NULL, &bp,
__find_main_battery);
if (error) {
main_battery = bp.main;
return -1;
}
+ if (!I.intval)
+ return 0;
+
switch (source) {
case SOURCE_CHARGE:
full_prop = POWER_SUPPLY_PROP_CHARGE_FULL;