From: patrick Date: Wed, 31 Aug 2022 23:31:35 +0000 (+0000) Subject: Compare equality of looked up node using pointers instead of X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3dbfdff05a25f524e5cab754496bc66c3e314a33;p=openbsd Compare equality of looked up node using pointers instead of strings, as the component name provided in the IORT might be specified in a different way than our ACPI stack would do. ok kettenis@ --- diff --git a/sys/arch/arm64/dev/acpiiort.c b/sys/arch/arm64/dev/acpiiort.c index 0d408fa0788..d7003d6bc59 100644 --- a/sys/arch/arm64/dev/acpiiort.c +++ b/sys/arch/arm64/dev/acpiiort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiiort.c,v 1.7 2022/08/31 20:49:12 patrick Exp $ */ +/* $OpenBSD: acpiiort.c,v 1.8 2022/08/31 23:31:35 patrick Exp $ */ /* * Copyright (c) 2021 Patrick Wildt * @@ -126,12 +126,10 @@ acpiiort_device_map(struct aml_node *root, bus_dma_tag_t dmat) struct acpi_iort_mapping *map; struct acpi_iort_nc_node *nc; struct acpi_q *entry; - const char *name; + struct aml_node *anc; uint32_t rid, offset; int i; - name = aml_nodename(root); - /* Look for IORT table. */ SIMPLEQ_FOREACH(entry, &acpi_softc->sc_tables, q_next) { hdr = entry->q_table; @@ -150,7 +148,9 @@ acpiiort_device_map(struct aml_node *root, bus_dma_tag_t dmat) node = (struct acpi_iort_node *)((char *)iort + offset); if (node->type == ACPI_IORT_NAMED_COMPONENT) { nc = (struct acpi_iort_nc_node *)&node[1]; - if (strcmp(nc->device_object_name, name) == 0) + anc = aml_searchname(acpi_softc->sc_root, + nc->device_object_name); + if (anc == root) break; } offset += node->length;