summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-01-17 17:40:44 +0000
committermav <mav@FreeBSD.org>2009-01-17 17:40:44 +0000
commit2a7f0d1fff86c0eacbbae4bc7532f55da810c955 (patch)
treea1f422d2f16b63e8332209e0b021bc670062b9a0
parent7b600fafdef3ffa79eb3537bbb9296653a1cc94f (diff)
downloadFreeBSD-src-2a7f0d1fff86c0eacbbae4bc7532f55da810c955.zip
FreeBSD-src-2a7f0d1fff86c0eacbbae4bc7532f55da810c955.tar.gz
Convert battery capacity/rate from mA to mW only when summary is requested.
Unconditional conversion causes incorrect rate units reported by acpiconf. MFC after: 2 weeks
-rw-r--r--sys/dev/acpica/acpi_battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpi_battery.c b/sys/dev/acpica/acpi_battery.c
index f289b2b..2e8c7a4 100644
--- a/sys/dev/acpica/acpi_battery.c
+++ b/sys/dev/acpica/acpi_battery.c
@@ -197,7 +197,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_battinfo *battinfo)
* is 0 (due to some error reading the battery), skip this
* conversion.
*/
- if (bif->units == ACPI_BIF_UNITS_MA && bif->dvol != 0) {
+ if (bif->units == ACPI_BIF_UNITS_MA && bif->dvol != 0 && dev == NULL) {
bst[i].rate = (bst[i].rate * bif->dvol) / 1000;
bst[i].cap = (bst[i].cap * bif->dvol) / 1000;
bif->lfcap = (bif->lfcap * bif->dvol) / 1000;
OpenPOWER on IntegriCloud