Merge git://git.infradead.org/battery-2.6
[safe/jmp/linux-2.6] / drivers / power / apm_power.c
index a832a9a..936bae5 100644 (file)
@@ -78,7 +78,7 @@ static void find_main_battery(void)
        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;
@@ -133,6 +133,9 @@ static int do_calculate_time(int status, enum apm_source source)
                        return -1;
        }
 
+       if (!I.intval)
+               return 0;
+
        switch (source) {
        case SOURCE_CHARGE:
                full_prop = POWER_SUPPLY_PROP_CHARGE_FULL;