X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fpower%2Fapm_power.c;h=936bae560fa1f730255bde8a94c9493c953efdfd;hb=93ff68a55aa92180a765d6c51c3303f6200167a6;hp=a832a9a05c66e8f469340978c52ad4db36c2ce08;hpb=dffd28a13a439e672c735d3fc87844d28cbacc65;p=linux-2.6-omap-h63xx.git diff --git a/drivers/power/apm_power.c b/drivers/power/apm_power.c index a832a9a05c6..936bae560fa 100644 --- a/drivers/power/apm_power.c +++ b/drivers/power/apm_power.c @@ -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;