ectool: Allow a negative value for battery charge rate
A negative value indicates the battery is discharging, so
allow ectool to display it.
TEST=cros deploy dut1 ec-utils
BRANCH=none
@@ -8021,9 +8021,8 @@ int cmd_battery(int argc, char *argv[])
printf(" Present voltage %u mV\n", val);
val = read_mapped_mem32(EC_MEMMAP_BATT_RATE);
- if (!is_battery_range(val))
- goto cmd_error;
- printf(" Present current %u mA\n", val);
+ /* Current can be negative */
+ printf(" Present current %d mA\n", val);
val = read_mapped_mem32(EC_MEMMAP_BATT_CAP);
if (!is_battery_range(val))
