Subject: [PATCH] correct AC Power info in /proc/pmu/info

From: Olaf Hering <[email-masked]>
Date: Sun, 12 Mar 2006 12:31:44 +0100

Report AC Power present in /proc/pmu/info if there is no battery.

Signed-off-by: Olaf Hering <[email-masked]>

---
 drivers/macintosh/via-pmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.16-rc6-olh/drivers/macintosh/via-pmu.c
===================================================================
--- linux-2.6.16-rc6-olh.orig/drivers/macintosh/via-pmu.c
+++ linux-2.6.16-rc6-olh/drivers/macintosh/via-pmu.c
@@ -825,7 +825,7 @@ proc_get_info(char *page, char **start, 
 	p += sprintf(p, "PMU driver version     : %d\n", PMU_DRIVER_VERSION);
 	p += sprintf(p, "PMU firmware version   : %02x\n", pmu_version);
 	p += sprintf(p, "AC Power               : %d\n",
-		((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0));
+		((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0) || pmu_battery_count == 0);
 	p += sprintf(p, "Battery count          : %d\n", pmu_battery_count);
 
 	return p - page;