Module Name: src
Committed By: jmcneill
Date: Mon Feb 25 19:28:36 UTC 2019
Modified Files:
src/sys/dev/fdt: fdtbus.c syscon.c
Log Message:
Attach syscon to "simple-mfd" devices and fix a bug with fdt_find_with_property
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/fdt/fdtbus.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/syscon.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/fdt/fdtbus.c
diff -u src/sys/dev/fdt/fdtbus.c:1.26 src/sys/dev/fdt/fdtbus.c:1.27
--- src/sys/dev/fdt/fdtbus.c:1.26 Sat Jan 19 20:50:48 2019
+++ src/sys/dev/fdt/fdtbus.c Mon Feb 25 19:28:36 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtbus.c,v 1.26 2019/01/19 20:50:48 jmcneill Exp $ */
+/* $NetBSD: fdtbus.c,v 1.27 2019/02/25 19:28:36 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.26 2019/01/19 20:50:48 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.27 2019/02/25 19:28:36 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -79,7 +79,7 @@ static void fdt_add_node(struct fdt_node
static u_int fdt_get_order(int);
static const char * const fdtbus_compatible[] =
- { "simple-bus", "simple-mfd", NULL };
+ { "simple-bus", NULL };
CFATTACH_DECL2_NEW(simplebus, sizeof(struct fdt_softc),
fdt_match, fdt_attach, NULL, NULL, fdt_rescan, fdt_childdet);
@@ -352,7 +352,7 @@ fdt_find_with_property(const char *prop,
int index = 0;
TAILQ_FOREACH(node, &fdt_nodes, n_nodes) {
- if (index < *pindex)
+ if (index++ < *pindex)
continue;
if (of_hasprop(node->n_phandle, prop)) {
*pindex = index;
Index: src/sys/dev/fdt/syscon.c
diff -u src/sys/dev/fdt/syscon.c:1.2 src/sys/dev/fdt/syscon.c:1.3
--- src/sys/dev/fdt/syscon.c:1.2 Sat Jun 30 16:22:56 2018
+++ src/sys/dev/fdt/syscon.c Mon Feb 25 19:28:36 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: syscon.c,v 1.2 2018/06/30 16:22:56 jmcneill Exp $ */
+/* $NetBSD: syscon.c,v 1.3 2019/02/25 19:28:36 jmcneill Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: syscon.c,v 1.2 2018/06/30 16:22:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscon.c,v 1.3 2019/02/25 19:28:36 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -54,6 +54,7 @@ static void syscon_attach(device_t, devi
static const char *compatible[] = {
"syscon",
+ "simple-mfd",
NULL
};