diff options
Diffstat (limited to 'sys/dev/acpica/acpi_battery.c')
-rw-r--r-- | sys/dev/acpica/acpi_battery.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi_battery.c b/sys/dev/acpica/acpi_battery.c index 51af72d..ec5e844 100644 --- a/sys/dev/acpica/acpi_battery.c +++ b/sys/dev/acpica/acpi_battery.c @@ -241,3 +241,19 @@ acpi_battery_register(int type, int phys_unit) return (0); } + +int +acpi_battery_remove(int type, int phys_unit) +{ + struct acpi_batteries *bp, *tmp; + + TAILQ_FOREACH_SAFE(bp, &acpi_batteries, link, tmp) { + if (bp->battdesc.type == type && bp->battdesc.phys_unit == phys_unit) { + TAILQ_REMOVE(&acpi_batteries, bp, link); + acpi_batteries_units--; + free(bp, M_ACPIBATT); + return (0); + } + } + return (ENOENT); +} |