From c48acf0a59434faa3f1df72a01fe0693aa6f548b Mon Sep 17 00:00:00 2001 From: jmatthew Date: Sun, 14 Jul 2024 13:58:57 +0000 Subject: [PATCH] For specific hids (currently only ACPI0007, acpicpu(4)), use a print function that always returns QUIET so instances that don't get matched are not reported. ok kettenis@ --- sys/dev/acpi/acpi.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 37e4d5b11f9..20aa4b9c2a0 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.434 2024/07/14 10:50:39 kettenis Exp $ */ +/* $OpenBSD: acpi.c,v 1.435 2024/07/14 13:58:57 jmatthew Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -65,6 +65,7 @@ void acpi_pci_set_powerstate(pci_chipset_tag_t, pcitag_t, int, int); int acpi_pci_notify(struct aml_node *, int, void *); int acpi_submatch(struct device *, void *, void *); +int acpi_noprint(void *, const char *); int acpi_print(void *, const char *); void acpi_map_pmregs(struct acpi_softc *); @@ -1316,6 +1317,12 @@ acpi_submatch(struct device *parent, void *match, void *aux) return ((*cf->cf_attach->ca_match)(parent, match, aux)); } +int +acpi_noprint(void *aux, const char *pnp) +{ + return (QUIET); +} + int acpi_print(void *aux, const char *pnp) { @@ -3010,6 +3017,12 @@ const char *acpi_isa_hids[] = { NULL }; +/* Overly abundant devices to avoid printing details for */ +const char *acpi_quiet_hids[] = { + "ACPI0007", + NULL +}; + void acpi_attach_deps(struct acpi_softc *sc, struct aml_node *node) { @@ -3229,7 +3242,10 @@ acpi_foundhid(struct aml_node *node, void *arg) if (!node->parent->attached) { node->parent->attached = 1; - config_found(self, &aaa, acpi_print); + if (acpi_matchhids(&aaa, acpi_quiet_hids, "none")) + config_found(self, &aaa, acpi_noprint); + else + config_found(self, &aaa, acpi_print); } return (0); -- 2.20.1