diff options
| author | thorpej <thorpej@NetBSD.org> | 2021-01-29 15:20:13 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2021-01-29 15:20:13 +0000 |
| commit | 6000aa0dcb941c5d9c512dd2ceae5a09b89f5f0c (patch) | |
| tree | d680cfe1e2ddbf1a426df28f9e8b88e30ab1bd84 /sys/dev | |
| parent | e46279f7d810123cd8c4fd2b0d2e320ca48f0b27 (diff) | |
Use acpi_compatible_match().
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/acpi/acpi_acad.c | 15 | ||||
| -rw-r--r-- | sys/dev/acpi/acpi_bat.c | 15 |
2 files changed, 12 insertions, 18 deletions
diff --git a/sys/dev/acpi/acpi_acad.c b/sys/dev/acpi/acpi_acad.c index 147e3472957..514d1a23e8a 100644 --- a/sys/dev/acpi/acpi_acad.c +++ b/sys/dev/acpi/acpi_acad.c @@ -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 @@ struct acpiacad_softc { 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 @@ acpiacad_match(device_t parent, cfdata_t match, void *aux) { 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 --git a/sys/dev/acpi/acpi_bat.c b/sys/dev/acpi/acpi_bat.c index 62f94c30af9..53cc9fb3e2a 100644 --- a/sys/dev/acpi/acpi_bat.c +++ b/sys/dev/acpi/acpi_bat.c @@ -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 @@ struct acpibat_softc { 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 @@ acpibat_match(device_t parent, cfdata_t match, void *aux) { 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); } /* |
