Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/fdt Replace 2 uses of of_match_compatible().



details:   https://anonhg.NetBSD.org/src/rev/3f5586c40b31
branches:  trunk
changeset: 950367:3f5586c40b31
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Jan 26 14:55:34 2021 +0000

description:
Replace 2 uses of of_match_compatible().

diffstat:

 sys/dev/fdt/fdtbus.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (49 lines):

diff -r 337a9687d5e2 -r 3f5586c40b31 sys/dev/fdt/fdtbus.c
--- a/sys/dev/fdt/fdtbus.c      Tue Jan 26 14:49:41 2021 +0000
+++ b/sys/dev/fdt/fdtbus.c      Tue Jan 26 14:55:34 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtbus.c,v 1.35 2020/09/20 11:25:36 jmcneill Exp $ */
+/* $NetBSD: fdtbus.c,v 1.36 2021/01/26 14:55:34 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.35 2020/09/20 11:25:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.36 2021/01/26 14:55:34 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -87,8 +87,10 @@
 static void    fdt_pre_attach(struct fdt_node *);
 static void    fdt_post_attach(struct fdt_node *);
 
-static const char * const fdtbus_compatible[] =
-    { "simple-bus", NULL };
+static const struct device_compatible_entry compat_data[] = {
+       { .compat = "simple-bus" },
+       { }
+};
 
 CFATTACH_DECL2_NEW(simplebus, sizeof(struct fdt_softc),
     fdt_match, fdt_attach, NULL, NULL, fdt_rescan, fdt_childdet);
@@ -101,7 +103,7 @@
        int match;
 
        /* Check compatible string */
-       match = of_match_compatible(phandle, fdtbus_compatible);
+       match = of_match_compat_data(phandle, compat_data);
        if (match)
                return match;
 
@@ -474,7 +476,7 @@
        struct fdt_node *node, *next;
 
        TAILQ_FOREACH_SAFE(node, &fdt_nodes, n_nodes, next) {
-               if (of_match_compatible(node->n_phandle, compatible)) {
+               if (of_compatible(node->n_phandle, compatible)) {
                        TAILQ_REMOVE(&fdt_nodes, node, n_nodes);
                }
        }



Home | Main Index | Thread Index | Old Index