power: ds2781: Fix reporting of negative temperatures
authorGreg Meiste <w30289@motorola.com>
Tue, 21 Sep 2010 19:57:22 +0000 (14:57 -0500)
committerColin Cross <ccross@android.com>
Thu, 7 Oct 2010 00:01:23 +0000 (17:01 -0700)
Need to save the temperature in a signed variable.  Otherwise, when the
temperature is below zero, an extremely hot temperature is reported to
the system, causing the device to power down.

Change-Id: I243bfc0fd1e1d76b2986e9def624de2b7782d731
Signed-off-by: Greg Meiste <w30289@motorola.com>
drivers/power/ds2781_battery.c

index 2548d9fc83ca410485464afefc9ee62a1087557d..82ebe9dc05a46d4378cc8cfdf8d10541ea1fa9ee 100644 (file)
@@ -48,7 +48,7 @@ struct battery_status {
        int current_avg_uA;
        int charge_uAh;
 
-       u16 temp_C;             /* units of 0.1 C */
+       short temp_C;           /* units of 0.1 C */
 
        u8 percentage;          /* battery percentage */
        u8 age_scalar;          /* converted to percent */