Module Name:    src
Committed By:   jmcneill
Date:           Thu Apr 13 22:27:07 UTC 2017

Modified Files:
        src/sys/dev/fdt: fdtbus.c

Log Message:
Allow devices to attach to nodes without a "compatible" property, but only
print "not configured" messages for nodes with one.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/fdt/fdtbus.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.4 src/sys/dev/fdt/fdtbus.c:1.5
--- src/sys/dev/fdt/fdtbus.c:1.4	Thu Apr 13 22:12:53 2017
+++ src/sys/dev/fdt/fdtbus.c	Thu Apr 13 22:27:07 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtbus.c,v 1.4 2017/04/13 22:12:53 jmcneill Exp $ */
+/* $NetBSD: fdtbus.c,v 1.5 2017/04/13 22:27:07 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.4 2017/04/13 22:12:53 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.5 2017/04/13 22:27:07 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -102,11 +102,6 @@ fdt_scan(device_t self, const struct fdt
 		struct fdt_attach_args nfaa = *faa;
 		nfaa.faa_phandle = child;
 
-		/* Only attach to nodes with a compatible property */
-		len = OF_getproplen(child, "compatible");
-		if (len <= 0)
-			continue;
-
 		/* If there is a "status" property, make sure it is "okay" */
 		len = OF_getproplen(child, "status");
 		if (len > 0) {
@@ -158,6 +153,10 @@ fdt_print(void *aux, const char *pnp)
 	char buf[FDT_MAX_PATH];
 	const char *name = buf;
 
+	/* Skip "not configured" for nodes w/o compatible property */
+	if (OF_getproplen(faa->faa_phandle, "compatible") <= 0)
+		return QUIET;
+
 	if (pnp) {
 		if (!fdtbus_get_path(faa->faa_phandle, buf, sizeof(buf)))
 			name = faa->faa_name;

Reply via email to