1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-12 14:29:28 +00:00

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
This commit is contained in:
Alexander Motin 2009-01-17 17:40:44 +00:00
parent 83409a55ec
commit 0f9e2596e2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=187368

View File

@ -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;