From dda08880ac3fb7880e81674f7f8ac5e81f8b06e5 Mon Sep 17 00:00:00 2001 From: Greg Meiste Date: Tue, 21 Sep 2010 14:57:22 -0500 Subject: [PATCH] power: ds2781: Fix reporting of negative temperatures 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 --- drivers/power/ds2781_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/ds2781_battery.c b/drivers/power/ds2781_battery.c index 2548d9fc83ca..82ebe9dc05a4 100644 --- a/drivers/power/ds2781_battery.c +++ b/drivers/power/ds2781_battery.c @@ -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 */ -- 2.34.1