Commit 55d7c851 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Linus Torvalds

[PATCH] ppc32: Fix warning in pmac battery code

The battery calculation code in via-pmu triggers a few warnings (and
actually, one of them would lead to a real error if we ever get an
unrecognized type from the PMU).  Fix this.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8683a182
......@@ -747,6 +747,8 @@ done_battery_state_smart(struct adb_request* req)
pmu_power_flags &= ~PMU_PWR_AC_PRESENT;
capa = max = amperage = voltage = 0;
if (req->reply[1] & 0x04) {
bat_flags |= PMU_BATT_PRESENT;
switch(req->reply[0]) {
......@@ -766,8 +768,7 @@ done_battery_state_smart(struct adb_request* req)
req->reply_len, req->reply[0], req->reply[1], req->reply[2], req->reply[3]);
break;
}
} else
capa = max = amperage = voltage = 0;
}
if ((req->reply[1] & 0x01) && (amperage > 0))
bat_flags |= PMU_BATT_CHARGING;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment