diff options
| author | thorpej <thorpej@NetBSD.org> | 2021-01-27 03:10:18 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2021-01-27 03:10:18 +0000 |
| commit | 8e90f9edc57cba116c1d7d9344aef70a09a0fcbd (patch) | |
| tree | 9738512c77bd45a94ff3b53ff14fb02b6b9eeee9 /sys/dev | |
| parent | 01632a17d0af21edb06aff4ee852a99a8bf2b595 (diff) | |
Rename of_match_compat_data() to of_compatible_match(). Similarly,
rename of_search_compatible() to of_compatible_lookup().
Standardize on of_compatible_match() for driver matching, and adapt
all call sites.
Diffstat (limited to 'sys/dev')
56 files changed, 329 insertions, 285 deletions
diff --git a/sys/dev/fdt/ahcisata_fdt.c b/sys/dev/fdt/ahcisata_fdt.c index 56ef196fb31..7552bf00d7f 100644 --- a/sys/dev/fdt/ahcisata_fdt.c +++ b/sys/dev/fdt/ahcisata_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ahcisata_fdt.c,v 1.2 2021/01/15 22:35:39 jmcneill Exp $ */ +/* $NetBSD: ahcisata_fdt.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> @@ -28,7 +28,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ahcisata_fdt.c,v 1.2 2021/01/15 22:35:39 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ahcisata_fdt.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -41,10 +41,10 @@ __KERNEL_RCSID(0, "$NetBSD: ahcisata_fdt.c,v 1.2 2021/01/15 22:35:39 jmcneill Ex #include <dev/fdt/fdtvar.h> -static const char * compatible[] = { - "snps,dwc-ahci", - "generic-ahci", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "snps,dwc-ahci" }, + { .compat = "generic-ahci" }, + DEVICE_COMPAT_EOL }; static int @@ -52,7 +52,7 @@ ahcisata_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/amdccp_fdt.c b/sys/dev/fdt/amdccp_fdt.c index b83969995f9..ee64fbaf5e6 100644 --- a/sys/dev/fdt/amdccp_fdt.c +++ b/sys/dev/fdt/amdccp_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: amdccp_fdt.c,v 1.5 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: amdccp_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2018 Jonathan A. Kollasch @@ -28,7 +28,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: amdccp_fdt.c,v 1.5 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amdccp_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -59,7 +59,7 @@ amdccp_fdt_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/arasan_sdhc_fdt.c b/sys/dev/fdt/arasan_sdhc_fdt.c index c212263502d..74a85d56ba4 100644 --- a/sys/dev/fdt/arasan_sdhc_fdt.c +++ b/sys/dev/fdt/arasan_sdhc_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: arasan_sdhc_fdt.c,v 1.5 2021/01/18 02:35:49 thorpej Exp $ */ +/* $NetBSD: arasan_sdhc_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: arasan_sdhc_fdt.c,v 1.5 2021/01/18 02:35:49 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arasan_sdhc_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -76,7 +76,12 @@ static const struct device_compatible_entry compat_data[] = { { .compat = "rockchip,rk3399-sdhci-5.1", .value = AS_TYPE_RK3399 }, - { 0 } + DEVICE_COMPAT_EOL +}; + +static const struct device_compatible_entry sdhci_5_1_compat[] = { + { .compat = "arasan,sdhci-5.1" }, + DEVICE_COMPAT_EOL }; static struct clk * @@ -185,13 +190,12 @@ static void arasan_sdhc_init(device_t dev) { struct arasan_sdhc_softc * const sc = device_private(dev); - const char * sdhci_5_1_compat[] = { "arasan,sdhci-5.1", NULL }; int error; if (sc->sc_type == AS_TYPE_RK3399) arasan_sdhc_init_rk3399(sc); - if (of_match_compatible(sc->sc_phandle, sdhci_5_1_compat)) { + if (of_compatible_match(sc->sc_phandle, sdhci_5_1_compat)) { sc->sc_phy = fdtbus_phy_get(sc->sc_phandle, "phy_arasan"); if (sc->sc_phy == NULL) { aprint_error_dev(dev, "couldn't get PHY\n"); @@ -212,7 +216,7 @@ arasan_sdhc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -264,7 +268,7 @@ arasan_sdhc_attach(device_t parent, device_t self, void *aux) return; } sc->sc_bsz = size; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; const uint32_t caps = bus_space_read_4(sc->sc_bst, sc->sc_bsh, SDHC_CAPABILITIES); if ((caps & (SDHC_ADMA2_SUPP|SDHC_64BIT_SYS_BUS)) == SDHC_ADMA2_SUPP) { diff --git a/sys/dev/fdt/ausoc.c b/sys/dev/fdt/ausoc.c index 7894eb37f50..b4e87ce2a83 100644 --- a/sys/dev/fdt/ausoc.c +++ b/sys/dev/fdt/ausoc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ausoc.c,v 1.5 2019/11/16 12:47:47 jmcneill Exp $ */ +/* $NetBSD: ausoc.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ausoc.c,v 1.5 2019/11/16 12:47:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ausoc.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -42,7 +42,10 @@ __KERNEL_RCSID(0, "$NetBSD: ausoc.c,v 1.5 2019/11/16 12:47:47 jmcneill Exp $"); #include <dev/fdt/fdtvar.h> -static const char *compatible[] = { "simple-audio-card", NULL }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "simple-audio-card" }, + DEVICE_COMPAT_EOL +}; struct ausoc_link { const char *link_name; @@ -343,7 +346,7 @@ ausoc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static struct { diff --git a/sys/dev/fdt/connector_fdt.c b/sys/dev/fdt/connector_fdt.c index c8813b3e883..5e3fba98da5 100644 --- a/sys/dev/fdt/connector_fdt.c +++ b/sys/dev/fdt/connector_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: connector_fdt.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: connector_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: connector_fdt.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: connector_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -82,7 +82,7 @@ fdt_connector_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args *faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -94,7 +94,7 @@ fdt_connector_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_phandle = phandle; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; SLIST_INSERT_HEAD(&fdt_connectors, sc, sc_list); diff --git a/sys/dev/fdt/cpufreq_dt.c b/sys/dev/fdt/cpufreq_dt.c index 939b9a4f29d..ea708037f5c 100644 --- a/sys/dev/fdt/cpufreq_dt.c +++ b/sys/dev/fdt/cpufreq_dt.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpufreq_dt.c,v 1.17 2020/06/03 19:55:13 jmcneill Exp $ */ +/* $NetBSD: cpufreq_dt.c,v 1.18 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cpufreq_dt.c,v 1.17 2020/06/03 19:55:13 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpufreq_dt.c,v 1.18 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -365,8 +365,12 @@ cpufreq_dt_lookup_opp_info(const int opp_table) int match, best_match = 0; __link_set_foreach(opp, fdt_opps) { - const char * const compat[] = { (*opp)->opp_compat, NULL }; - match = of_match_compatible(opp_table, compat); + const struct device_compatible_entry compat_data[] = { + { .compat = (*opp)->opp_compat }, + DEVICE_COMPAT_EOL + }; + + match = of_compatible_match(opp_table, compat_data); if (match > best_match) { best_match = match; best_opp = *opp; diff --git a/sys/dev/fdt/dw_apb_uart.c b/sys/dev/fdt/dw_apb_uart.c index 4e3c2c3dfd3..84d73f6be5c 100644 --- a/sys/dev/fdt/dw_apb_uart.c +++ b/sys/dev/fdt/dw_apb_uart.c @@ -1,4 +1,4 @@ -/* $NetBSD: dw_apb_uart.c,v 1.9 2021/01/15 20:50:49 ryo Exp $ */ +/* $NetBSD: dw_apb_uart.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca> @@ -28,7 +28,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.9 2021/01/15 20:50:49 ryo Exp $"); +__KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -45,9 +45,9 @@ __KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.9 2021/01/15 20:50:49 ryo Exp $"); static int dw_apb_uart_match(device_t, cfdata_t, void *); static void dw_apb_uart_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "snps,dw-apb-uart", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "snps,dw-apb-uart" }, + DEVICE_COMPAT_EOL }; struct dw_apb_uart_softc { @@ -67,7 +67,7 @@ dw_apb_uart_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -152,7 +152,7 @@ dw_apb_uart_attach(device_t parent, device_t self, void *aux) static int dw_apb_uart_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/dev/fdt/dwc2_fdt.c b/sys/dev/fdt/dwc2_fdt.c index cfdfc049a89..25c81713cb4 100644 --- a/sys/dev/fdt/dwc2_fdt.c +++ b/sys/dev/fdt/dwc2_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwc2_fdt.c,v 1.9 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: dwc2_fdt.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dwc2_fdt.c,v 1.9 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc2_fdt.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -104,7 +104,7 @@ dwc2_fdt_match(device_t parent, struct cfdata *match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } /* ARGSUSED */ @@ -115,7 +115,7 @@ dwc2_fdt_attach(device_t parent, device_t self, void *aux) struct fdt_attach_args * const faa = aux; const int phandle = faa->faa_phandle; const struct dwc2_fdt_config *conf = - of_search_compatible(phandle, compat_data)->data; + of_compatible_lookup(phandle, compat_data)->data; char intrstr[128]; struct fdtbus_phy *phy; struct clk *clk; diff --git a/sys/dev/fdt/dwc3_fdt.c b/sys/dev/fdt/dwc3_fdt.c index 86e8c540c13..ff280dafc71 100644 --- a/sys/dev/fdt/dwc3_fdt.c +++ b/sys/dev/fdt/dwc3_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwc3_fdt.c,v 1.12 2021/01/15 20:50:49 ryo Exp $ */ +/* $NetBSD: dwc3_fdt.c,v 1.13 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.12 2021/01/15 20:50:49 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.13 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -202,31 +202,33 @@ dwc3_fdt_set_mode(struct xhci_softc *sc, u_int mode) WR4(sc, DWC3_GCTL, val); } +static const struct device_compatible_entry compat_data[] = { + /* 1 = parent of dwc3 subnode */ + { .compat = "allwinner,sun50i-h6-dwc3", .value = 1 }, + { .compat = "amlogic,meson-gxl-dwc3", .value = 1 }, + { .compat = "fsl,imx8mq-dwc3", .value = 1 }, + { .compat = "rockchip,rk3328-dwc3", .value = 1 }, + { .compat = "rockchip,rk3399-dwc3", .value = 1 }, + { .compat = "samsung,exynos5250-dwusb3", .value = 1 }, + { .compat = "snps,dwc3", .value = 0 }, + DEVICE_COMPAT_EOL +}; + static int dwc3_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "allwinner,sun50i-h6-dwc3", - "amlogic,meson-gxl-dwc3", - "fsl,imx8mq-dwc3", - "rockchip,rk3328-dwc3", - "rockchip,rk3399-dwc3", - "samsung,exynos5250-dwusb3", - "snps,dwc3", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void dwc3_fdt_attach(device_t parent, device_t self, void *aux) { - const char * const dwc3_compatible[] = { "snps,dwc3", NULL }; struct xhci_softc * const sc = device_private(self); struct fdt_attach_args * const faa = aux; const int phandle = faa->faa_phandle; + const struct device_compatible_entry *dce; struct fdtbus_reset *rst; struct fdtbus_phy *phy; struct clk *clk; @@ -237,11 +239,14 @@ dwc3_fdt_attach(device_t parent, device_t self, void *aux) void *ih; u_int n; + dce = of_compatible_lookup(phandle, compat_data); + KASSERT(dce != NULL); + /* Find dwc3 sub-node */ - if (of_match_compatible(phandle, dwc3_compatible) > 0) { - dwc3_phandle = phandle; - } else { + if (dce->value != 0) { dwc3_phandle = of_find_firstchild_byname(phandle, "dwc3"); + } else { + dwc3_phandle = phandle; } if (dwc3_phandle <= 0) { aprint_error(": couldn't find dwc3 child node\n"); diff --git a/sys/dev/fdt/dwcmmc_fdt.c b/sys/dev/fdt/dwcmmc_fdt.c index c63e11ae749..5964d08ad4f 100644 --- a/sys/dev/fdt/dwcmmc_fdt.c +++ b/sys/dev/fdt/dwcmmc_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwcmmc_fdt.c,v 1.15 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: dwcmmc_fdt.c,v 1.16 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015-2018 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.15 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.16 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -90,7 +90,7 @@ dwcmmc_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -150,7 +150,7 @@ dwcmmc_fdt_attach(device_t parent, device_t self, void *aux) (uint64_t)addr, error); return; } - esc->sc_conf = of_search_compatible(phandle, compat_data)->data; + esc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; if (of_getprop_uint32(phandle, "max-frequency", &sc->sc_clock_freq) != 0) sc->sc_clock_freq = UINT_MAX; diff --git a/sys/dev/fdt/dwcwdt_fdt.c b/sys/dev/fdt/dwcwdt_fdt.c index e9d01fd26d1..c993e5d9527 100644 --- a/sys/dev/fdt/dwcwdt_fdt.c +++ b/sys/dev/fdt/dwcwdt_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwcwdt_fdt.c,v 1.4 2019/10/19 13:08:52 tnn Exp $ */ +/* $NetBSD: dwcwdt_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dwcwdt_fdt.c,v 1.4 2019/10/19 13:08:52 tnn Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwcwdt_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -82,9 +82,9 @@ static const uint32_t wdt_torr[] = { #define DWCWDT_PERIOD_DEFAULT 15 -static const char * const compatible[] = { - "snps,dw-wdt", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "snps,dw-wdt" }, + DEVICE_COMPAT_EOL }; struct dwcwdt_softc { @@ -168,7 +168,7 @@ dwcwdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/dwiic_fdt.c b/sys/dev/fdt/dwiic_fdt.c index 9844793cbf9..82ce90099ec 100644 --- a/sys/dev/fdt/dwiic_fdt.c +++ b/sys/dev/fdt/dwiic_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwiic_fdt.c,v 1.3 2021/01/15 22:35:39 jmcneill Exp $ */ +/* $NetBSD: dwiic_fdt.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dwiic_fdt.c,v 1.3 2021/01/15 22:35:39 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwiic_fdt.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -41,9 +41,9 @@ __KERNEL_RCSID(0, "$NetBSD: dwiic_fdt.c,v 1.3 2021/01/15 22:35:39 jmcneill Exp $ #include <dev/fdt/fdtvar.h> #include <dev/ic/dwiic_var.h> -static const char * const compatible[] = { - "snps,designware-i2c", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "snps,designware-i2c" }, + DEVICE_COMPAT_EOL }; struct dwiic_fdt_softc { @@ -61,7 +61,7 @@ dwiic_fdt_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } void diff --git a/sys/dev/fdt/ehci_fdt.c b/sys/dev/fdt/ehci_fdt.c index 0927cbb57db..05bb2db4845 100644 --- a/sys/dev/fdt/ehci_fdt.c +++ b/sys/dev/fdt/ehci_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci_fdt.c,v 1.5 2021/01/15 20:50:49 ryo Exp $ */ +/* $NetBSD: ehci_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.5 2021/01/15 20:50:49 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -52,16 +52,17 @@ CFATTACH_DECL2_NEW(ehci_fdt, sizeof(struct ehci_softc), ehci_fdt_match, ehci_fdt_attach, NULL, ehci_activate, NULL, ehci_childdet); +static const struct device_compatible_entry compat_data[] = { + { .compat = "generic-ehci" }, + DEVICE_COMPAT_EOL +}; + static int ehci_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "generic-ehci", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/fdt_panel.c b/sys/dev/fdt/fdt_panel.c index fdac5d89322..cc864d334cb 100644 --- a/sys/dev/fdt/fdt_panel.c +++ b/sys/dev/fdt/fdt_panel.c @@ -1,4 +1,4 @@ -/* $NetBSD: fdt_panel.c,v 1.2 2019/12/19 16:00:52 jakllsch Exp $ */ +/* $NetBSD: fdt_panel.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jonathan A. Kollasch <jakllsch@kollasch.net> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.2 2019/12/19 16:00:52 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -44,9 +44,9 @@ __KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.2 2019/12/19 16:00:52 jakllsch Exp $ #include <drm/drm_panel.h> #include <drm/drm_edid.h> -static const char * const compatible[] = { - "simple-panel", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "simple-panel" }, + DEVICE_COMPAT_EOL }; struct panel_fdt_softc { @@ -127,7 +127,7 @@ panel_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/fdtbus.c b/sys/dev/fdt/fdtbus.c index f3d58e2764f..4b58a58adbf 100644 --- a/sys/dev/fdt/fdtbus.c +++ b/sys/dev/fdt/fdtbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: fdtbus.c,v 1.37 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: fdtbus.c,v 1.38 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.37 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.38 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -103,7 +103,7 @@ fdt_match(device_t parent, cfdata_t cf, void *aux) int match; /* Check compatible string */ - match = of_match_compat_data(phandle, compat_data); + match = of_compatible_match(phandle, compat_data); if (match) return match; diff --git a/sys/dev/fdt/fixedclock.c b/sys/dev/fdt/fixedclock.c index 62434d445ef..9fc914973ed 100644 --- a/sys/dev/fdt/fixedclock.c +++ b/sys/dev/fdt/fixedclock.c @@ -1,4 +1,4 @@ -/* $NetBSD: fixedclock.c,v 1.5 2018/09/09 07:21:18 aymeric Exp $ */ +/* $NetBSD: fixedclock.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared D. McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fixedclock.c,v 1.5 2018/09/09 07:21:18 aymeric Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fixedclock.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -74,13 +74,17 @@ struct fixedclock_softc { CFATTACH_DECL_NEW(fclock, sizeof(struct fixedclock_softc), fixedclock_match, fixedclock_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "fixed-clock" }, + DEVICE_COMPAT_EOL +}; + static int fixedclock_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "fixed-clock", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/fixedfactorclock.c b/sys/dev/fdt/fixedfactorclock.c index c979c2fc365..2bfbe382828 100644 --- a/sys/dev/fdt/fixedfactorclock.c +++ b/sys/dev/fdt/fixedfactorclock.c @@ -1,4 +1,4 @@ -/* $NetBSD: fixedfactorclock.c,v 1.3 2018/09/09 07:21:18 aymeric Exp $ */ +/* $NetBSD: fixedfactorclock.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fixedfactorclock.c,v 1.3 2018/09/09 07:21:18 aymeric Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fixedfactorclock.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -76,13 +76,17 @@ struct fixedfactorclock_softc { CFATTACH_DECL_NEW(ffclock, sizeof(struct fixedfactorclock_softc), fixedfactorclock_match, fixedfactorclock_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "fixed-factor-clock" }, + DEVICE_COMPAT_EOL +}; + static int fixedfactorclock_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "fixed-factor-clock", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/fixedregulator.c b/sys/dev/fdt/fixedregulator.c index 6624552fde6..ce468d915d4 100644 --- a/sys/dev/fdt/fixedregulator.c +++ b/sys/dev/fdt/fixedregulator.c @@ -1,4 +1,4 @@ -/* $NetBSD: fixedregulator.c,v 1.9 2021/01/17 19:54:23 jmcneill Exp $ */ +/* $NetBSD: fixedregulator.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fixedregulator.c,v 1.9 2021/01/17 19:54:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fixedregulator.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -74,13 +74,17 @@ struct fixedregulator_softc { CFATTACH_DECL_NEW(fregulator, sizeof(struct fixedregulator_softc), fixedregulator_match, fixedregulator_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "regulator-fixed" }, + DEVICE_COMPAT_EOL +}; + static int fixedregulator_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "regulator-fixed", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/genet_fdt.c b/sys/dev/fdt/genet_fdt.c index bc34498f1bf..d4a99c8cbe8 100644 --- a/sys/dev/fdt/genet_fdt.c +++ b/sys/dev/fdt/genet_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: genet_fdt.c,v 1.3 2021/01/15 22:35:39 jmcneill Exp $ */ +/* $NetBSD: genet_fdt.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2020 Jared McNeill <jmcneill@invisible.ca> @@ -29,7 +29,7 @@ #include "opt_net_mpsafe.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: genet_fdt.c,v 1.3 2021/01/15 22:35:39 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: genet_fdt.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -61,16 +61,17 @@ static void genet_fdt_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(genet_fdt, sizeof(struct genet_softc), genet_fdt_match, genet_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2711-genet-v5" }, + DEVICE_COMPAT_EOL +}; + static int genet_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "brcm,bcm2711-genet-v5", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/gpiokeys.c b/sys/dev/fdt/gpiokeys.c index 812da79084f..18d95354b03 100644 --- a/sys/dev/fdt/gpiokeys.c +++ b/sys/dev/fdt/gpiokeys.c @@ -1,4 +1,4 @@ -/* $NetBSD: gpiokeys.c,v 1.8 2018/05/10 13:05:18 jmcneill Exp $ */ +/* $NetBSD: gpiokeys.c,v 1.9 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gpiokeys.c,v 1.8 2018/05/10 13:05:18 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gpiokeys.c,v 1.9 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -140,13 +140,17 @@ static const struct wskbd_accessops gpiokeys_accessops = { .ioctl = gpiokeys_ioctl }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "gpio-keys" }, + DEVICE_COMPAT_EOL +}; + static int gpiokeys_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "gpio-keys", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/gpioleds.c b/sys/dev/fdt/gpioleds.c index 6ae12690049..b27573b4b4e 100644 --- a/sys/dev/fdt/gpioleds.c +++ b/sys/dev/fdt/gpioleds.c @@ -1,4 +1,4 @@ -/* $NetBSD: gpioleds.c,v 1.1 2017/07/08 00:55:02 jmcneill Exp $ */ +/* $NetBSD: gpioleds.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gpioleds.c,v 1.1 2017/07/08 00:55:02 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gpioleds.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -62,13 +62,17 @@ gpioleds_set(void *priv, int state) fdtbus_gpio_write(pin, state); } +static const struct device_compatible_entry compat_data[] = { + { .compat = "gpio-leds" }, + DEVICE_COMPAT_EOL +}; + static int gpioleds_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "gpio-leds", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/gpioregulator.c b/sys/dev/fdt/gpioregulator.c index 7f784682479..275b4ff36fa 100644 --- a/sys/dev/fdt/gpioregulator.c +++ b/sys/dev/fdt/gpioregulator.c @@ -1,4 +1,4 @@ -/* $NetBSD: gpioregulator.c,v 1.3 2021/01/17 19:54:23 jmcneill Exp $ */ +/* $NetBSD: gpioregulator.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gpioregulator.c,v 1.3 2021/01/17 19:54:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gpioregulator.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -83,13 +83,17 @@ struct gpioregulator_softc { CFATTACH_DECL_NEW(gregulator, sizeof(struct gpioregulator_softc), gpioregulator_match, gpioregulator_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "regulator-gpio" }, + DEVICE_COMPAT_EOL +}; + static int gpioregulator_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "regulator-gpio", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/hdmi_connector.c b/sys/dev/fdt/hdmi_connector.c index de580b4a737..862495c0043 100644 --- a/sys/dev/fdt/hdmi_connector.c +++ b/sys/dev/fdt/hdmi_connector.c @@ -1,4 +1,4 @@ -/* $NetBSD: hdmi_connector.c,v 1.1 2019/01/30 01:24:00 jmcneill Exp $ */ +/* $NetBSD: hdmi_connector.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hdmi_connector.c,v 1.1 2019/01/30 01:24:00 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdmi_connector.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -45,9 +45,9 @@ __KERNEL_RCSID(0, "$NetBSD: hdmi_connector.c,v 1.1 2019/01/30 01:24:00 jmcneill #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h> -static const char * const compatible[] = { - "hdmi-connector", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "hdmi-connector" }, + DEVICE_COMPAT_EOL }; struct dispcon_hdmi_connector { @@ -210,7 +210,7 @@ dispcon_hdmi_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/i2cmux_fdt.c b/sys/dev/fdt/i2cmux_fdt.c index 7feeb49fd0e..ce2353f782d 100644 --- a/sys/dev/fdt/i2cmux_fdt.c +++ b/sys/dev/fdt/i2cmux_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: i2cmux_fdt.c,v 1.9 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: i2cmux_fdt.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i2cmux_fdt.c,v 1.9 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i2cmux_fdt.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/types.h> #include <sys/device.h> @@ -251,7 +251,7 @@ iicmux_fdt_match(device_t const parent, cfdata_t const match, void * const aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -262,7 +262,7 @@ iicmux_fdt_attach(device_t const parent, device_t const self, void * const aux) sc->sc_dev = self; sc->sc_handle = faa->faa_phandle; - sc->sc_config = of_search_compatible(sc->sc_handle, compat_data)->data; + sc->sc_config = of_compatible_lookup(sc->sc_handle, compat_data)->data; aprint_naive("\n"); aprint_normal(": %s I2C mux\n", sc->sc_config->desc); diff --git a/sys/dev/fdt/mmc_pwrseq_emmc.c b/sys/dev/fdt/mmc_pwrseq_emmc.c index a26578fea70..419a32ec2d1 100644 --- a/sys/dev/fdt/mmc_pwrseq_emmc.c +++ b/sys/dev/fdt/mmc_pwrseq_emmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mmc_pwrseq_emmc.c,v 1.1 2019/03/03 12:54:07 jmcneill Exp $ */ +/* $NetBSD: mmc_pwrseq_emmc.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_emmc.c,v 1.1 2019/03/03 12:54:07 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_emmc.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -40,9 +40,9 @@ __KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_emmc.c,v 1.1 2019/03/03 12:54:07 jmcneill #define MMCPWRSEQ_MAX_PINS 32 -static const char * const compatible[] = { - "mmc-pwrseq-emmc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "mmc-pwrseq-emmc" }, + DEVICE_COMPAT_EOL }; struct mmcpwrseq_emmc_softc { @@ -71,7 +71,7 @@ mmcpwrseq_emmc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/mmc_pwrseq_simple.c b/sys/dev/fdt/mmc_pwrseq_simple.c index 22122242d4c..2cda231e8e2 100644 --- a/sys/dev/fdt/mmc_pwrseq_simple.c +++ b/sys/dev/fdt/mmc_pwrseq_simple.c @@ -1,4 +1,4 @@ -/* $NetBSD: mmc_pwrseq_simple.c,v 1.2 2019/03/03 12:54:07 jmcneill Exp $ */ +/* $NetBSD: mmc_pwrseq_simple.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_simple.c,v 1.2 2019/03/03 12:54:07 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_simple.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -40,9 +40,9 @@ __KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_simple.c,v 1.2 2019/03/03 12:54:07 jmcnei #define MMCPWRSEQ_MAX_PINS 32 -static const char * const compatible[] = { - "mmc-pwrseq-simple", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "mmc-pwrseq-simple" }, + DEVICE_COMPAT_EOL }; struct mmcpwrseq_simple_softc { @@ -109,7 +109,7 @@ mmcpwrseq_simple_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/ns8250_uart.c b/sys/dev/fdt/ns8250_uart.c index 8b122207b14..879d02861f1 100644 --- a/sys/dev/fdt/ns8250_uart.c +++ b/sys/dev/fdt/ns8250_uart.c @@ -1,4 +1,4 @@ -/* $NetBSD: ns8250_uart.c,v 1.6 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: ns8250_uart.c,v 1.7 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017-2020 Jared McNeill <jmcneill@invisible.ca> @@ -28,7 +28,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: ns8250_uart.c,v 1.6 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: ns8250_uart.c,v 1.7 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -95,7 +95,7 @@ ns8250_uart_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -115,7 +115,7 @@ ns8250_uart_attach(device_t parent, device_t self, void *aux) void *ih; const struct ns8250_config *config = - of_search_compatible(phandle, compat_data)->data; + of_compatible_lookup(phandle, compat_data)->data; if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) { aprint_error(": couldn't get registers\n"); @@ -180,7 +180,7 @@ ns8250_uart_attach(device_t parent, device_t self, void *aux) static int ns8250_uart_console_match(int phandle) { - return of_match_compat_data(phandle, compat_data); + return of_compatible_match(phandle, compat_data); } static void @@ -196,7 +196,7 @@ ns8250_uart_console_consinit(struct fdt_attach_args *faa, u_int uart_freq) int speed; const struct ns8250_config *config = - of_search_compatible(phandle, compat_data)->data; + of_compatible_lookup(phandle, compat_data)->data; fdtbus_get_reg(phandle, 0, &addr, NULL); speed = fdtbus_get_stdout_speed(); diff --git a/sys/dev/fdt/ohci_fdt.c b/sys/dev/fdt/ohci_fdt.c index 37d83b52020..32a1165c664 100644 --- a/sys/dev/fdt/ohci_fdt.c +++ b/sys/dev/fdt/ohci_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ohci_fdt.c,v 1.4 2021/01/15 20:50:49 ryo Exp $ */ +/* $NetBSD: ohci_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ohci_fdt.c,v 1.4 2021/01/15 20:50:49 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -52,16 +52,17 @@ CFATTACH_DECL2_NEW(ohci_fdt, sizeof(struct ohci_softc), ohci_fdt_match, ohci_fdt_attach, NULL, ohci_activate, NULL, ohci_childdet); +static const struct device_compatible_entry compat_data[] = { + { .compat = "generic-ohci" }, + DEVICE_COMPAT_EOL +}; + static int ohci_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "generic-ohci", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/panel_fdt.c b/sys/dev/fdt/panel_fdt.c index 2e7b471c933..c3daf44671c 100644 --- a/sys/dev/fdt/panel_fdt.c +++ b/sys/dev/fdt/panel_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: panel_fdt.c,v 1.5 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: panel_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: panel_fdt.c,v 1.5 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: panel_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -79,7 +79,7 @@ fdt_panel_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args *faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -98,7 +98,7 @@ fdt_panel_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_phandle = phandle; sc->sc_panel.panel_type = - of_search_compatible(phandle, compat_data)->value; + of_compatible_lookup(phandle, compat_data)->value; if (of_getprop_uint32(phandle, "width-mm", &sc->sc_panel.panel_width) || of_getprop_uint32(phandle, "height-mm", &sc->sc_panel.panel_height)){ diff --git a/sys/dev/fdt/pinctrl_single.c b/sys/dev/fdt/pinctrl_single.c index dc3f2951080..8d3a2864b10 100644 --- a/sys/dev/fdt/pinctrl_single.c +++ b/sys/dev/fdt/pinctrl_single.c @@ -1,4 +1,4 @@ -/* $NetBSD: pinctrl_single.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: pinctrl_single.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pinctrl_single.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pinctrl_single.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -140,7 +140,7 @@ pinctrl_single_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -159,7 +159,7 @@ pinctrl_single_attach(device_t parent, device_t self, void *aux) return; } - conf = of_search_compatible(phandle, compat_data)->data; + conf = of_compatible_lookup(phandle, compat_data)->data; sc->sc_dev = self; sc->sc_phandle = phandle; diff --git a/sys/dev/fdt/pl061gpio_fdt.c b/sys/dev/fdt/pl061gpio_fdt.c index b1ba57873c6..0abe69dec30 100644 --- a/sys/dev/fdt/pl061gpio_fdt.c +++ b/sys/dev/fdt/pl061gpio_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl061gpio_fdt.c,v 1.4 2018/10/15 23:53:47 jmcneill Exp $ */ +/* $NetBSD: pl061gpio_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2018 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pl061gpio_fdt.c,v 1.4 2018/10/15 23:53:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pl061gpio_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -71,16 +71,17 @@ struct plgpio_fdt_pin { CFATTACH_DECL_NEW(plgpio_fdt, sizeof(struct plgpio_softc), plgpio_fdt_match, plgpio_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,pl061" }, + DEVICE_COMPAT_EOL +}; + static int plgpio_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "arm,pl061", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/pwm_backlight.c b/sys/dev/fdt/pwm_backlight.c index 038aa127d97..eec787b8bf4 100644 --- a/sys/dev/fdt/pwm_backlight.c +++ b/sys/dev/fdt/pwm_backlight.c @@ -1,4 +1,4 @@ -/* $NetBSD: pwm_backlight.c,v 1.8 2020/05/20 05:24:35 hkenken Exp $ */ +/* $NetBSD: pwm_backlight.c,v 1.9 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pwm_backlight.c,v 1.8 2020/05/20 05:24:35 hkenken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pwm_backlight.c,v 1.9 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -63,9 +63,9 @@ static void pwm_backlight_pmf_init(struct pwm_backlight_softc *); static void pwm_backlight_set(struct pwm_backlight_softc *, u_int, bool); static u_int pwm_backlight_get(struct pwm_backlight_softc *); -static const char *compatible[] = { - "pwm-backlight", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "pwm-backlight" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(pwmbacklight, sizeof(struct pwm_backlight_softc), @@ -76,7 +76,7 @@ pwm_backlight_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/pwm_fan.c b/sys/dev/fdt/pwm_fan.c index b2199df4985..b67954bdf10 100644 --- a/sys/dev/fdt/pwm_fan.c +++ b/sys/dev/fdt/pwm_fan.c @@ -1,4 +1,4 @@ -/* $NetBSD: pwm_fan.c,v 1.1 2018/07/04 23:08:06 jmcneill Exp $ */ +/* $NetBSD: pwm_fan.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pwm_fan.c,v 1.1 2018/07/04 23:08:06 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pwm_fan.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -55,9 +55,9 @@ static void pwm_fan_attach(device_t, device_t, void *); static void pwm_fan_set(struct pwm_fan_softc *, u_int); -static const char *compatible[] = { - "pwm-fan", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "pwm-fan" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(pwmfan, sizeof(struct pwm_fan_softc), @@ -68,7 +68,7 @@ pwm_fan_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/pwmregulator.c b/sys/dev/fdt/pwmregulator.c index c3a0695439b..7a42a1fc042 100644 --- a/sys/dev/fdt/pwmregulator.c +++ b/sys/dev/fdt/pwmregulator.c @@ -1,4 +1,4 @@ -/* $NetBSD: pwmregulator.c,v 1.2 2021/01/01 03:07:51 ryo Exp $ */ +/* $NetBSD: pwmregulator.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2020 Ryo Shimizu <ryo@nerv.org> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pwmregulator.c,v 1.2 2021/01/01 03:07:51 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pwmregulator.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -78,9 +78,9 @@ struct pwmregulator_softc { CFATTACH_DECL_NEW(pregulator, sizeof(struct pwmregulator_softc), pwmregulator_match, pwmregulator_attach, NULL, NULL); -static const char * const compatible[] = { - "pwm-regulator", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "pwm-regulator" }, + DEVICE_COMPAT_EOL }; static int @@ -88,7 +88,7 @@ pwmregulator_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/qemufwcfg_fdt.c b/sys/dev/fdt/qemufwcfg_fdt.c index 7e1bb6c0320..a3c6917a5e7 100644 --- a/sys/dev/fdt/qemufwcfg_fdt.c +++ b/sys/dev/fdt/qemufwcfg_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: qemufwcfg_fdt.c,v 1.1 2018/06/15 15:07:56 jakllsch Exp $ */ +/* $NetBSD: qemufwcfg_fdt.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: qemufwcfg_fdt.c,v 1.1 2018/06/15 15:07:56 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: qemufwcfg_fdt.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -49,9 +49,9 @@ CFATTACH_DECL_NEW(qemufwcfg_fdt, sizeof(struct fwcfg_softc), NULL ); -static const char * const compatible[] = { - "qemu,fw-cfg-mmio", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "qemu,fw-cfg-mmio" }, + DEVICE_COMPAT_EOL }; @@ -60,7 +60,7 @@ fwcfg_fdt_match(device_t parent, cfdata_t match, void *opaque) { struct fdt_attach_args * const faa = opaque; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/simple_amplifier.c b/sys/dev/fdt/simple_amplifier.c index a28d46a7ae7..3c5f81750cf 100644 --- a/sys/dev/fdt/simple_amplifier.c +++ b/sys/dev/fdt/simple_amplifier.c @@ -1,4 +1,4 @@ -/* $NetBSD: simple_amplifier.c,v 1.1 2020/01/02 00:57:09 jmcneill Exp $ */ +/* $NetBSD: simple_amplifier.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2020 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: simple_amplifier.c,v 1.1 2020/01/02 00:57:09 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: simple_amplifier.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -50,9 +50,9 @@ struct simple_amplifier_softc { static int simple_amplifier_match(device_t, cfdata_t, void *); static void simple_amplifier_attach(device_t, device_t, void *); -static const char *compatible[] = { - "simple-audio-amplifier", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "simple-audio-amplifier" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(simpleamp, sizeof(struct simple_amplifier_softc), @@ -113,7 +113,7 @@ simple_amplifier_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/simplefb.c b/sys/dev/fdt/simplefb.c index 32a7238db0e..5a84fcba99d 100644 --- a/sys/dev/fdt/simplefb.c +++ b/sys/dev/fdt/simplefb.c @@ -1,4 +1,4 @@ -/* $NetBSD: simplefb.c,v 1.11 2020/10/21 11:02:31 rin Exp $ */ +/* $NetBSD: simplefb.c,v 1.12 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca> @@ -29,7 +29,7 @@ #include "opt_wsdisplay_compat.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.11 2020/10/21 11:02:31 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.12 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -40,9 +40,9 @@ __KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.11 2020/10/21 11:02:31 rin Exp $"); #include <dev/wsfb/genfbvar.h> -static const char * const compatible[] = { - "simple-framebuffer", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "simple-framebuffer" }, + DEVICE_COMPAT_EOL }; struct simplefb_softc { @@ -231,7 +231,7 @@ simplefb_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -255,7 +255,7 @@ CFATTACH_DECL_NEW(simplefb, sizeof(struct simplefb_softc), static int simplefb_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/dev/fdt/spdif_tx.c b/sys/dev/fdt/spdif_tx.c index 901f3f7e962..d4512718046 100644 --- a/sys/dev/fdt/spdif_tx.c +++ b/sys/dev/fdt/spdif_tx.c @@ -1,4 +1,4 @@ -/* $NetBSD: spdif_tx.c,v 1.1 2019/11/17 19:30:42 jmcneill Exp $ */ +/* $NetBSD: spdif_tx.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spdif_tx.c,v 1.1 2019/11/17 19:30:42 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spdif_tx.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -48,9 +48,9 @@ struct spdif_tx_softc { static int spdif_tx_match(device_t, cfdata_t, void *); static void spdif_tx_attach(device_t, device_t, void *); -static const char *compatible[] = { - "linux,spdif-dit", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "linux,spdif-dit" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(spdiftx, sizeof(struct spdif_tx_softc), @@ -90,7 +90,7 @@ spdif_tx_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/syscon.c b/sys/dev/fdt/syscon.c index 3ad87e166a1..906453980d6 100644 --- a/sys/dev/fdt/syscon.c +++ b/sys/dev/fdt/syscon.c @@ -1,4 +1,4 @@ -/* $NetBSD: syscon.c,v 1.4 2019/10/28 21:13:48 jmcneill Exp $ */ +/* $NetBSD: syscon.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: syscon.c,v 1.4 2019/10/28 21:13:48 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: syscon.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -52,10 +52,10 @@ struct syscon_softc { static int syscon_match(device_t, cfdata_t, void *); static void syscon_attach(device_t, device_t, void *); -static const char *compatible[] = { - "syscon", - "simple-mfd", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "syscon" }, + { .compat = "simple-mfd" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(syscon, sizeof(struct syscon_softc), @@ -102,7 +102,7 @@ syscon_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/usbnopphy.c b/sys/dev/fdt/usbnopphy.c index 2f1345dce7f..173fd82d1ab 100644 --- a/sys/dev/fdt/usbnopphy.c +++ b/sys/dev/fdt/usbnopphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbnopphy.c,v 1.1 2019/10/30 21:37:56 jmcneill Exp $ */ +/* $NetBSD: usbnopphy.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca> @@ -28,7 +28,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: usbnopphy.c,v 1.1 2019/10/30 21:37:56 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbnopphy.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -42,9 +42,9 @@ __KERNEL_RCSID(0, "$NetBSD: usbnopphy.c,v 1.1 2019/10/30 21:37:56 jmcneill Exp $ static int usbnopphy_match(device_t, cfdata_t, void *); static void usbnopphy_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "usb-nop-xceiv", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "usb-nop-xceiv" }, + DEVICE_COMPAT_EOL }; struct usbnopphy_softc { @@ -117,7 +117,7 @@ usbnopphy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/virtio_mmio_fdt.c b/sys/dev/fdt/virtio_mmio_fdt.c index 76c5f610792..f5da1f4db68 100644 --- a/sys/dev/fdt/virtio_mmio_fdt.c +++ b/sys/dev/fdt/virtio_mmio_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: virtio_mmio_fdt.c,v 1.6 2021/01/20 21:59:48 reinoud Exp $ */ +/* $NetBSD: virtio_mmio_fdt.c,v 1.7 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2018 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: virtio_mmio_fdt.c,v 1.6 2021/01/20 21:59:48 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: virtio_mmio_fdt.c,v 1.7 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -56,9 +56,9 @@ CFATTACH_DECL3_NEW(virtio_mmio_fdt, sizeof(struct virtio_mmio_fdt_softc), virtio_mmio_fdt_match, virtio_mmio_fdt_attach, virtio_mmio_fdt_detach, NULL, virtio_mmio_fdt_rescan, (void *)voidop, DVF_DETACH_SHUTDOWN); -static const char * const compatible[] = { - "virtio,mmio", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "virtio,mmio" }, + DEVICE_COMPAT_EOL }; static int @@ -66,7 +66,7 @@ virtio_mmio_fdt_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/vmt_fdt.c b/sys/dev/fdt/vmt_fdt.c index b4b818330b3..3eb91e51dba 100644 --- a/sys/dev/fdt/vmt_fdt.c +++ b/sys/dev/fdt/vmt_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: vmt_fdt.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: vmt_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2020 Ryo Shimizu <ryo@nerv.org> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vmt_fdt.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vmt_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -55,7 +55,7 @@ vmt_fdt_match(device_t parent, cfdata_t cf, void *aux) if (OF_finddevice("/hypervisor") != faa->faa_phandle) return 0; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/i2c/twl4030.c b/sys/dev/i2c/twl4030.c index 0bceed4930d..0987ce8fb35 100644 --- a/sys/dev/i2c/twl4030.c +++ b/sys/dev/i2c/twl4030.c @@ -1,4 +1,4 @@ -/* $NetBSD: twl4030.c,v 1.5 2021/01/27 02:28:37 thorpej Exp $ */ +/* $NetBSD: twl4030.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca> @@ -29,7 +29,7 @@ #include "opt_fdt.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: twl4030.c,v 1.5 2021/01/27 02:28:37 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: twl4030.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -390,10 +390,10 @@ twl_attach(device_t parent, device_t self, void *aux) #ifdef FDT for (int child = OF_child(sc->sc_phandle); child; child = OF_peer(child)) { - if (of_match_compat_data(child, gpio_compat_data)) { + if (of_compatible_match(child, gpio_compat_data)) { aprint_normal(", GPIO"); twl_gpio_attach(sc, child); - } else if (of_match_compat_data(child, rtc_compat_data)) { + } else if (of_compatible_match(child, rtc_compat_data)) { aprint_normal(", RTC"); twl_rtc_attach(sc, child); } diff --git a/sys/dev/ofisa/atppc_ofisa.c b/sys/dev/ofisa/atppc_ofisa.c index ffd834792d5..af61fcd2d27 100644 --- a/sys/dev/ofisa/atppc_ofisa.c +++ b/sys/dev/ofisa/atppc_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: atppc_ofisa.c,v 1.13 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: atppc_ofisa.c,v 1.14 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: atppc_ofisa.c,v 1.13 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atppc_ofisa.c,v 1.14 2021/01/27 03:10:21 thorpej Exp $"); #include "opt_atppc.h" @@ -88,7 +88,7 @@ atppc_ofisa_match(device_t parent, cfdata_t match, void *aux) struct ofisa_attach_args *aa = aux; int rv; - rv = of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; #ifdef _LPT_OFISA_MD_MATCH if (!rv) rv = lpt_ofisa_md_match(parent, match, aux); diff --git a/sys/dev/ofisa/com_ofisa.c b/sys/dev/ofisa/com_ofisa.c index 65345d04f5b..99dfddb7c09 100644 --- a/sys/dev/ofisa/com_ofisa.c +++ b/sys/dev/ofisa/com_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: com_ofisa.c,v 1.19 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: com_ofisa.c,v 1.20 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright 1997, 1998 @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: com_ofisa.c,v 1.19 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com_ofisa.c,v 1.20 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -79,7 +79,7 @@ com_ofisa_probe(device_t parent, cfdata_t cf, void *aux) struct ofisa_attach_args *aa = aux; int rv; - rv = of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; #ifdef _COM_OFISA_MD_MATCH if (!rv) rv = com_ofisa_md_match(parent, cf, aux); diff --git a/sys/dev/ofisa/ess_ofisa.c b/sys/dev/ofisa/ess_ofisa.c index 03da11ab6c3..286176b1d7e 100644 --- a/sys/dev/ofisa/ess_ofisa.c +++ b/sys/dev/ofisa/ess_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: ess_ofisa.c,v 1.31 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: ess_ofisa.c,v 1.32 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ess_ofisa.c,v 1.31 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ess_ofisa.c,v 1.32 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -69,7 +69,7 @@ ess_ofisa_match(device_t parent, cfdata_t cf, void *aux) struct ofisa_attach_args *aa = aux; /* beat generic SB */ - return of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 10 : 0; + return of_compatible_match(aa->oba.oba_phandle, compat_data) ? 10 : 0; } void diff --git a/sys/dev/ofisa/if_cs_ofisa.c b/sys/dev/ofisa/if_cs_ofisa.c index b43f2d0f4e3..555ad9292f5 100644 --- a/sys/dev/ofisa/if_cs_ofisa.c +++ b/sys/dev/ofisa/if_cs_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cs_ofisa.c,v 1.30 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: if_cs_ofisa.c,v 1.31 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_cs_ofisa.c,v 1.30 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cs_ofisa.c,v 1.31 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -79,7 +79,7 @@ cs_ofisa_match(device_t parent, cfdata_t cf, void *aux) struct ofisa_attach_args *aa = aux; int rv; - rv = of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; #ifdef _CS_OFISA_MD_MATCH if (rv == 0) rv = cs_ofisa_md_match(parent, cf, aux); diff --git a/sys/dev/ofisa/joy_ofisa.c b/sys/dev/ofisa/joy_ofisa.c index 1bfebda3f01..c9a2d47e2a3 100644 --- a/sys/dev/ofisa/joy_ofisa.c +++ b/sys/dev/ofisa/joy_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: joy_ofisa.c,v 1.19 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: joy_ofisa.c,v 1.20 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 1996, 1998, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: joy_ofisa.c,v 1.19 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: joy_ofisa.c,v 1.20 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -68,7 +68,7 @@ joy_ofisa_match(device_t parent, cfdata_t match, void *aux) { struct ofisa_attach_args *aa = aux; - return of_match_compat_data(aa->oba.oba_phandle, compat_data); + return of_compatible_match(aa->oba.oba_phandle, compat_data); } static void diff --git a/sys/dev/ofisa/lpt_ofisa.c b/sys/dev/ofisa/lpt_ofisa.c index e8da463bb1e..42cb0b0d375 100644 --- a/sys/dev/ofisa/lpt_ofisa.c +++ b/sys/dev/ofisa/lpt_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpt_ofisa.c,v 1.18 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: lpt_ofisa.c,v 1.19 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright 1997, 1998 @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lpt_ofisa.c,v 1.18 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lpt_ofisa.c,v 1.19 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -79,7 +79,7 @@ lpt_ofisa_probe(device_t parent, cfdata_t cf, void *aux) struct ofisa_attach_args *aa = aux; int rv; - rv = of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; #ifdef _LPT_OFISA_MD_MATCH if (!rv) rv = lpt_ofisa_md_match(parent, cf, aux); diff --git a/sys/dev/ofisa/ofisa.c b/sys/dev/ofisa/ofisa.c index 6c16718caab..88664b1a322 100644 --- a/sys/dev/ofisa/ofisa.c +++ b/sys/dev/ofisa/ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofisa.c,v 1.29 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: ofisa.c,v 1.30 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright 1997, 1998 @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ofisa.c,v 1.29 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofisa.c,v 1.30 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -86,7 +86,7 @@ ofisamatch(device_t parent, cfdata_t cf, void *aux) struct ofbus_attach_args *oba = aux; int rv; - rv = of_match_compat_data(oba->oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(oba->oba_phandle, compat_data) ? 5 : 0; #ifdef _OFISA_MD_MATCH if (!rv) rv = ofisa_md_match(parent, cf, aux); diff --git a/sys/dev/ofisa/pckbc_ofisa.c b/sys/dev/ofisa/pckbc_ofisa.c index 746bd343c52..454be1d9196 100644 --- a/sys/dev/ofisa/pckbc_ofisa.c +++ b/sys/dev/ofisa/pckbc_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: pckbc_ofisa.c,v 1.18 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: pckbc_ofisa.c,v 1.19 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 1998 @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pckbc_ofisa.c,v 1.18 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pckbc_ofisa.c,v 1.19 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -80,7 +80,7 @@ pckbc_ofisa_match(device_t parent, cfdata_t match, void *aux) { struct ofisa_attach_args *aa = aux; - return of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + return of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; } static void @@ -103,7 +103,7 @@ pckbc_ofisa_attach(device_t parent, device_t self, void *aux) phandle = OF_child(aa->oba.oba_phandle); while (phandle != 0) { - dce = of_search_compatible(phandle, port_compat_data); + dce = of_compatible_lookup(phandle, port_compat_data); if (dce != NULL) { ofisa_intr_get(phandle, &osc->sc_intr[dce->value], 1); } diff --git a/sys/dev/ofisa/sb_ofisa.c b/sys/dev/ofisa/sb_ofisa.c index 70a86dc55e9..3cb536b0201 100644 --- a/sys/dev/ofisa/sb_ofisa.c +++ b/sys/dev/ofisa/sb_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: sb_ofisa.c,v 1.22 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: sb_ofisa.c,v 1.23 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sb_ofisa.c,v 1.22 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sb_ofisa.c,v 1.23 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -75,7 +75,7 @@ sb_ofisa_match(device_t parent, cfdata_t cf, void *aux) * Use a low match priority so that a more specific driver * can match, e.g. a native ESS driver. */ - return of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 1 : 0; + return of_compatible_match(aa->oba.oba_phandle, compat_data) ? 1 : 0; } void diff --git a/sys/dev/ofisa/wdc_ofisa.c b/sys/dev/ofisa/wdc_ofisa.c index ca3c7e4d1cc..516bd513188 100644 --- a/sys/dev/ofisa/wdc_ofisa.c +++ b/sys/dev/ofisa/wdc_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: wdc_ofisa.c,v 1.39 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: wdc_ofisa.c,v 1.40 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright 1997, 1998 @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wdc_ofisa.c,v 1.39 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wdc_ofisa.c,v 1.40 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -82,7 +82,7 @@ wdc_ofisa_probe(device_t parent, cfdata_t cf, void *aux) struct ofisa_attach_args *aa = aux; int rv; - rv = of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; #ifdef _WDC_OFISA_MD_MATCH if (!rv) rv = wdc_ofisa_md_match(parent, cf, aux); diff --git a/sys/dev/ofw/ofw_subr.c b/sys/dev/ofw/ofw_subr.c index 046e7a76f61..542d718a5d9 100644 --- a/sys/dev/ofw/ofw_subr.c +++ b/sys/dev/ofw/ofw_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_subr.c,v 1.53 2021/01/26 14:55:57 thorpej Exp $ */ +/* $NetBSD: ofw_subr.c,v 1.54 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright 1998 @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.53 2021/01/26 14:55:57 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.54 2021/01/27 03:10:21 thorpej Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -80,7 +80,7 @@ of_decode_int(const unsigned char *p) * This routine checks an OFW node's "compatible" entry to see if * it matches any of the provided strings. * - * of_match_compat_data() is the preferred way to perform driver + * of_compatible_match() is the preferred way to perform driver * compatibility match. However, this routine that deals with * only strings is useful in some situations and is provided for * convenience. @@ -142,7 +142,7 @@ of_match_compatible(int phandle, const char * const *strings) } /* - * int of_match_compat_data(phandle, compat_data) + * int of_compatible_match(phandle, compat_data) * * This routine searches an array of device_compatible_entry structures * for a matching "compatible" entry matching the supplied OFW node, @@ -170,7 +170,7 @@ of_match_compatible(int phandle, const char * const *strings) * None. */ int -of_match_compat_data(int phandle, +of_compatible_match(int phandle, const struct device_compatible_entry *compat_data) { char *prop, propbuf[OFW_MAX_STACK_BUF_SIZE]; @@ -195,7 +195,7 @@ of_match_compat_data(int phandle, } /* - * const struct device_compatible_entry *of_search_compatible(phandle, + * const struct device_compatible_entry *of_compatible_lookup(phandle, * compat_data) * * This routine searches an array of device_compatible_entry structures @@ -217,7 +217,7 @@ of_match_compat_data(int phandle, * None. */ const struct device_compatible_entry * -of_search_compatible(int phandle, +of_compatible_lookup(int phandle, const struct device_compatible_entry *compat_data) { char *prop, propbuf[OFW_MAX_STACK_BUF_SIZE]; diff --git a/sys/dev/ofw/openfirm.h b/sys/dev/ofw/openfirm.h index 8f6108658d5..474dba3967f 100644 --- a/sys/dev/ofw/openfirm.h +++ b/sys/dev/ofw/openfirm.h @@ -1,4 +1,4 @@ -/* $NetBSD: openfirm.h,v 1.42 2021/01/25 19:59:49 mrg Exp $ */ +/* $NetBSD: openfirm.h,v 1.43 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -107,9 +107,9 @@ struct device_compatible_entry; int of_compatible(int, const char * const *); int of_match_compatible(int, const char * const *); -int of_match_compat_data(int, const struct device_compatible_entry *); +int of_compatible_match(int, const struct device_compatible_entry *); const struct device_compatible_entry * - of_search_compatible(int, const struct device_compatible_entry *); + of_compatible_lookup(int, const struct device_compatible_entry *); int of_decode_int(const unsigned char *); int of_packagename(int, char *, int); int of_find_firstchild_byname(int, const char *); diff --git a/sys/dev/sdmmc/if_bwfm_sdio.c b/sys/dev/sdmmc/if_bwfm_sdio.c index df70a034e8d..a4bb4259882 100644 --- a/sys/dev/sdmmc/if_bwfm_sdio.c +++ b/sys/dev/sdmmc/if_bwfm_sdio.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bwfm_sdio.c,v 1.24 2020/11/03 09:26:41 mlelstv Exp $ */ +/* $NetBSD: if_bwfm_sdio.c,v 1.25 2021/01/27 03:10:21 thorpej Exp $ */ /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation @@ -304,9 +304,9 @@ static const struct bwfm_sdio_product { }, }; -static const char * const compatible[] = { - "brcm,bcm4329-fmac", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm4329-fmac" }, + DEVICE_COMPAT_EOL }; static int @@ -583,7 +583,7 @@ bwfm_fdt_find_phandle(device_t self, device_t parent) phandle = OF_child(OF_finddevice(str)); } - if (!of_match_compatible(phandle, compatible)) + if (!of_compatible_match(phandle, compat_data)) return -1; return phandle; |
