[PATCH] macintosh: correct AC Power info in /proc/pmu/info
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 14 Mar 2006 05:20:42 +0000 (21:20 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 14 Mar 2006 15:57:17 +0000 (07:57 -0800)
Report AC Power present in /proc/pmu/info if there is no battery.

Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/macintosh/via-pmu.c

index 6eb93e45fcd3f624005714b5c27dc7205e703c12..4a478eb0e27dabfa73b169072090abadfea2e143 100644 (file)
@@ -825,7 +825,7 @@ proc_get_info(char *page, char **start, off_t off,
        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;