Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi Use acpi_compatible_match().



details:   https://anonhg.NetBSD.org/src/rev/71729b1ae4c3
branches:  trunk
changeset: 959214:71729b1ae4c3
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Feb 04 23:59:46 2021 +0000

description:
Use acpi_compatible_match().

diffstat:

 sys/dev/acpi/dwiic_acpi.c |  21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diffs (49 lines):

diff -r e836ce6d2d04 -r 71729b1ae4c3 sys/dev/acpi/dwiic_acpi.c
--- a/sys/dev/acpi/dwiic_acpi.c Thu Feb 04 23:54:48 2021 +0000
+++ b/sys/dev/acpi/dwiic_acpi.c Thu Feb 04 23:59:46 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwiic_acpi.c,v 1.6 2021/01/26 00:19:53 jmcneill Exp $ */
+/* $NetBSD: dwiic_acpi.c,v 1.7 2021/02/04 23:59:46 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwiic_acpi.c,v 1.6 2021/01/26 00:19:53 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwiic_acpi.c,v 1.7 2021/02/04 23:59:46 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -59,12 +59,12 @@
 
 CFATTACH_DECL_NEW(dwiic_acpi, sizeof(struct dwiic_softc), dwiic_acpi_match, dwiic_acpi_attach, NULL, NULL);
 
-static const char * const compatible[] = {
-       "AMD0010",      /* AMD FCH */
-       "AMDI0010",     /* AMD FCH */
-       "AMDI0510",     /* AMD Seattle */
-       "APMC0D0F",     /* Ampere eMAG */
-       NULL
+static const struct device_compatible_entry compat_data[] = {
+       { .compat = "AMD0010" },        /* AMD FCH */
+       { .compat = "AMDI0010" },       /* AMD FCH */
+       { .compat = "AMDI0510" },       /* AMD Seattle */
+       { .compat = "APMC0D0F" },       /* Ampere eMAG */
+       DEVICE_COMPAT_EOL
 };
 
 static int
@@ -72,10 +72,7 @@
 {
        struct acpi_attach_args *aa = aux;
 
-       if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
-               return 0;
-
-       return acpi_match_hid(aa->aa_node->ad_devinfo, compatible);
+       return acpi_compatible_match(aa, compat_data);
 }
 
 static void



Home | Main Index | Thread Index | Old Index