Found this diff on one of my machines.  Not sure why I didn't commit
it yet.  The purpose of acpi_register_gpio() was to avoid duplicating
the code.

ok?


Index: dev/acpi/bytgpio.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/bytgpio.c,v
retrieving revision 1.12
diff -u -p -r1.12 bytgpio.c
--- dev/acpi/bytgpio.c  25 Oct 2016 06:48:58 -0000      1.12
+++ dev/acpi/bytgpio.c  30 Apr 2018 07:13:48 -0000
@@ -125,8 +125,6 @@ bytgpio_attach(struct device *parent, st
        struct acpi_attach_args *aaa = aux;
        struct bytgpio_softc *sc = (struct bytgpio_softc *)self;
        struct aml_value res;
-       struct aml_value arg[2];
-       struct aml_node *node;
        int64_t uid;
        uint32_t reg;
        int i;
@@ -219,16 +217,7 @@ bytgpio_attach(struct device *parent, st
 
        printf(", %d pins\n", sc->sc_npins);
 
-       /* Register address space. */
-       memset(&arg, 0, sizeof(arg));
-       arg[0].type = AML_OBJTYPE_INTEGER;
-       arg[0].v_integer = ACPI_OPREG_GPIO;
-       arg[1].type = AML_OBJTYPE_INTEGER;
-       arg[1].v_integer = 1;
-       node = aml_searchname(sc->sc_node, "_REG");
-       if (node && aml_evalnode(sc->sc_acpi, node, 2, arg, NULL))
-               printf("%s: _REG failed\n", sc->sc_dev.dv_xname);
-               
+       acpi_register_gpio(sc->sc_acpi, sc->sc_node);
        return;
 
 unmap:

Reply via email to