I'm working on some i2c drivers that are closely tied to acpi.  These
drivers need to call into acpi and need to know their acpi node.  The
diff below makes dwiic(4) pass the acpi node as the cookie to its
children.  This matches what we do in ofw/fdt land where we pass the
device tree node.

ok?


Index: dwiic_acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/dwiic_acpi.c,v
retrieving revision 1.5
diff -u -p -r1.5 dwiic_acpi.c
--- dwiic_acpi.c        18 May 2018 06:49:47 -0000      1.5
+++ dwiic_acpi.c        19 May 2018 19:40:43 -0000
@@ -393,6 +393,7 @@ dwiic_acpi_found_hid(struct aml_node *no
        ia.ia_tag = sc->sc_iba.iba_tag;
        ia.ia_name = dev;
        ia.ia_addr = crs.i2c_addr;
+       ia.ia_cookie = node->parent;
 
        config_found(sc->sc_iic, &ia, dwiic_i2c_print);
        node->parent->attached = 1;

Reply via email to