diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2005-12-28 03:18:57 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2005-12-28 03:18:57 +0000 |
commit | 9f43bac684444ea5ef18189bbf25fe3814602693 (patch) | |
tree | 330e488a14f18e5cc99ebb53290ee126ffab673f /sys/dev/acpi | |
parent | daad0453e6bac24f292c51d7b9fb436bd3ecc6f6 (diff) |
Add some return values to getbst and getbif.
ok jordan@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r-- | sys/dev/acpi/acpibat.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sys/dev/acpi/acpibat.c b/sys/dev/acpi/acpibat.c index 96dc335f40b..959069f69ee 100644 --- a/sys/dev/acpi/acpibat.c +++ b/sys/dev/acpi/acpibat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpibat.c,v 1.4 2005/12/28 03:08:33 marco Exp $ */ +/* $OpenBSD: acpibat.c,v 1.5 2005/12/28 03:18:56 marco Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * @@ -52,8 +52,8 @@ struct cfdriver acpibat_cd = { NULL, "acpibat", DV_DULL }; -void acpibat_getbif(struct acpibat_softc *); -void acpibat_getbst(struct acpibat_softc *); +int acpibat_getbif(struct acpibat_softc *); +int acpibat_getbst(struct acpibat_softc *); int acpibat_match(struct device *parent, void *match, void *aux) @@ -80,12 +80,12 @@ acpibat_attach(struct device *parent, struct device *self, void *aux) sc->sc_acpi = (struct acpi_softc *)parent; sc->sc_devnode = aa->aaa_node->child; - /* acpibat_getbif(sc); */ + acpibat_getbif(sc); printf("\n"); } -void +int acpibat_getbif(struct acpibat_softc *sc) { struct aml_value res, env; @@ -96,13 +96,13 @@ acpibat_getbif(struct acpibat_softc *sc) if (aml_eval_name(sc->sc_acpi, sc->sc_devnode, "_BIF", &res, &env)) { dprintf(50, "%s: no _BIF\n", DEVNAME(sc)); - return; + return (1); } if (res.length != 13) { printf("%s: invalid _BIF, battery information not saved\n", DEVNAME(sc)); - return; + return (1); } sc->sc_bif.bif_power_unit = aml_intval(&res.v_package[0]); @@ -135,9 +135,11 @@ acpibat_getbif(struct acpibat_softc *sc) sc->sc_bif.bif_serial, sc->sc_bif.bif_type, sc->sc_bif.bif_oem); + + return (0); } -void +int acpibat_getbst(struct acpibat_softc *sc) { struct aml_value res, env; @@ -148,13 +150,13 @@ acpibat_getbst(struct acpibat_softc *sc) if (aml_eval_name(sc->sc_acpi, sc->sc_devnode, "_BST", &res, &env)) { dprintf(50, "%s: no _BST\n", DEVNAME(sc)); - return; + return (1); } if (res.length != 4) { printf("%s: invalid _BST, battery status not saved\n", DEVNAME(sc)); - return; + return (1); } sc->sc_bst.bst_state = aml_intval(&res.v_package[0]); @@ -167,4 +169,6 @@ acpibat_getbst(struct acpibat_softc *sc) sc->sc_bst.bst_rate, sc->sc_bst.bst_capacity, sc->sc_bst.bst_voltage); + + return (0); } |