Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi_battery.c
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | acpi_battery_get_battinfo(device_t dev, struct acpi_battinfo *battinfo) | ||||
/* If examining a specific battery and this is it, record its index. */ | /* If examining a specific battery and this is it, record its index. */ | ||||
if (dev != NULL && dev == batt_dev) | if (dev != NULL && dev == batt_dev) | ||||
dev_idx = i; | dev_idx = i; | ||||
/* | /* | ||||
* Be sure we can get various info from the battery. | * Be sure we can get various info from the battery. | ||||
*/ | */ | ||||
if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || | if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || | ||||
ACPI_BATT_GET_INFO(batt_dev, bif) != 0) | ACPI_BATT_GET_INFO(batt_dev, bif) != 0) | ||||
continue; | continue; | ||||
/* If a battery is not installed, we sometimes get strange values. */ | /* If a battery is not installed, we sometimes get strange values. */ | ||||
if (!acpi_battery_bst_valid(&bst[i]) || | if (!acpi_battery_bst_valid(&bst[i]) || | ||||
!acpi_battery_bif_valid(bif)) | !acpi_battery_bif_valid(bif)) | ||||
continue; | continue; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 332 Lines • Show Last 20 Lines |