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/bfc532740400
branches:  trunk
changeset: 959023:bfc532740400
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jan 29 15:20:13 2021 +0000

description:
Use acpi_compatible_match().

diffstat:

 sys/dev/acpi/acpi_acad.c |  15 ++++++---------
 sys/dev/acpi/acpi_bat.c  |  15 ++++++---------
 2 files changed, 12 insertions(+), 18 deletions(-)

diffs (86 lines):

diff -r ea02651b79a0 -r bfc532740400 sys/dev/acpi/acpi_acad.c
--- a/sys/dev/acpi/acpi_acad.c  Fri Jan 29 14:11:14 2021 +0000
+++ b/sys/dev/acpi/acpi_acad.c  Fri Jan 29 15:20:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_acad.c,v 1.51 2015/04/23 23:23:00 pgoyette Exp $  */
+/*     $NetBSD: acpi_acad.c,v 1.52 2021/01/29 15:20:13 thorpej Exp $   */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.51 2015/04/23 23:23:00 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.52 2021/01/29 15:20:13 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -64,9 +64,9 @@
        int                      sc_status;
 };
 
-static const char * const acad_hid[] = {
-       "ACPI0003",
-       NULL
+static const struct device_compatible_entry compat_data[] = {
+       { .compat = "ACPI0003" },
+       DEVICE_COMPAT_EOL
 };
 
 static int     acpiacad_match(device_t, cfdata_t, void *);
@@ -90,10 +90,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, acad_hid);
+       return acpi_compatible_match(aa, compat_data);
 }
 
 /*
diff -r ea02651b79a0 -r bfc532740400 sys/dev/acpi/acpi_bat.c
--- a/sys/dev/acpi/acpi_bat.c   Fri Jan 29 14:11:14 2021 +0000
+++ b/sys/dev/acpi/acpi_bat.c   Fri Jan 29 15:20:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_bat.c,v 1.116 2018/08/10 17:11:56 riastradh Exp $ */
+/*     $NetBSD: acpi_bat.c,v 1.117 2021/01/29 15:20:13 thorpej Exp $   */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.116 2018/08/10 17:11:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.117 2021/01/29 15:20:13 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -159,9 +159,9 @@
        int                      sc_present;
 };
 
-static const char * const bat_hid[] = {
-       "PNP0C0A",
-       NULL
+static const struct device_compatible_entry compat_data[] = {
+       { .compat = "PNP0C0A" },
+       DEVICE_COMPAT_EOL
 };
 
 #define ACPIBAT_PWRUNIT_MA     0x00000001  /* mA not mW */
@@ -207,10 +207,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, bat_hid);
+       return acpi_compatible_match(aa, compat_data);
 }
 
 /*



Home | Main Index | Thread Index | Old Index