summaryrefslogtreecommitdiff
path: root/drivers/power/jz4740-battery.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/jz4740-battery.c')
-rw-r--r--drivers/power/jz4740-battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/jz4740-battery.c b/drivers/power/jz4740-battery.c
index abdfc21ec..88f04f4d1 100644
--- a/drivers/power/jz4740-battery.c
+++ b/drivers/power/jz4740-battery.c
@@ -208,7 +208,7 @@ static void jz_battery_update(struct jz_battery *jz_battery)
}
voltage = jz_battery_read_voltage(jz_battery);
- if (abs(voltage - jz_battery->voltage) < 50000) {
+ if (voltage >= 0 && abs(voltage - jz_battery->voltage) > 50000) {
jz_battery->voltage = voltage;
has_changed = true;
}