aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/apm_emu.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/macintosh/apm_emu.c b/drivers/macintosh/apm_emu.c
index 19d3e05d6825..e5a2bbf99399 100644
--- a/drivers/macintosh/apm_emu.c
+++ b/drivers/macintosh/apm_emu.c
@@ -430,8 +430,8 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
430 -1: Unknown 430 -1: Unknown
431 8) min = minutes; sec = seconds */ 431 8) min = minutes; sec = seconds */
432 432
433 unsigned short ac_line_status = 0xff; 433 unsigned short ac_line_status;
434 unsigned short battery_status = 0xff; 434 unsigned short battery_status = 0;
435 unsigned short battery_flag = 0xff; 435 unsigned short battery_flag = 0xff;
436 int percentage = -1; 436 int percentage = -1;
437 int time_units = -1; 437 int time_units = -1;
@@ -446,6 +446,7 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
446 ac_line_status = ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0); 446 ac_line_status = ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0);
447 for (i=0; i<pmu_battery_count; i++) { 447 for (i=0; i<pmu_battery_count; i++) {
448 if (pmu_batteries[i].flags & PMU_BATT_PRESENT) { 448 if (pmu_batteries[i].flags & PMU_BATT_PRESENT) {
449 battery_status++;
449 if (percentage < 0) 450 if (percentage < 0)
450 percentage = 0; 451 percentage = 0;
451 if (charge < 0) 452 if (charge < 0)
@@ -461,6 +462,9 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
461 charging++; 462 charging++;
462 } 463 }
463 } 464 }
465 if (0 == battery_status)
466 ac_line_status = 1;
467 battery_status = 0xff;
464 if (real_count) { 468 if (real_count) {
465 if (amperage < 0) { 469 if (amperage < 0) {
466 if (btype == PMU_BATT_TYPE_SMART) 470 if (btype == PMU_BATT_TYPE_SMART)