From 51bf1d552925980fc505b294fe77f64c6f570f00 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 22 Aug 2020 22:29:29 +0000 Subject: Don't complain when child nodes don't have a _CRS method. This happens for example for control method batteries that are attached to I2C but use an OperationRegion() to access the I2C device. ok jcs@, gnedzo@ --- sys/dev/acpi/dwiic_acpi.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sys') diff --git a/sys/dev/acpi/dwiic_acpi.c b/sys/dev/acpi/dwiic_acpi.c index 5cb014bba61..0c9b25e0956 100644 --- a/sys/dev/acpi/dwiic_acpi.c +++ b/sys/dev/acpi/dwiic_acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwiic_acpi.c,v 1.15 2020/07/23 09:21:51 jsg Exp $ */ +/* $OpenBSD: dwiic_acpi.c,v 1.16 2020/08/22 22:29:28 kettenis Exp $ */ /* * Synopsys DesignWare I2C controller * @@ -369,11 +369,9 @@ dwiic_acpi_found_hid(struct aml_node *node, void *arg) DPRINTF(("%s: found HID %s at %s\n", sc->sc_dev.dv_xname, dev, aml_nodename(node))); - if (aml_evalname(acpi_softc, node->parent, "_CRS", 0, NULL, &res)) { - printf("%s: no _CRS method at %s\n", sc->sc_dev.dv_xname, - aml_nodename(node->parent)); - return (0); - } + if (aml_evalname(acpi_softc, node->parent, "_CRS", 0, NULL, &res)) + return 0; + if (res.type != AML_OBJTYPE_BUFFER || res.length < 5) { printf("%s: invalid _CRS object (type %d len %d)\n", sc->sc_dev.dv_xname, res.type, res.length); -- cgit v1.2.3