Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/fdt Allow devices to attach to nodes without a "comp...
details: https://anonhg.NetBSD.org/src/rev/71d1ea8135f2
branches: trunk
changeset: 352900:71d1ea8135f2
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Thu Apr 13 22:27:07 2017 +0000
description:
Allow devices to attach to nodes without a "compatible" property, but only
print "not configured" messages for nodes with one.
diffstat:
sys/dev/fdt/fdtbus.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diffs (41 lines):
diff -r f688f0c4b5d9 -r 71d1ea8135f2 sys/dev/fdt/fdtbus.c
--- a/sys/dev/fdt/fdtbus.c Thu Apr 13 22:12:53 2017 +0000
+++ b/sys/dev/fdt/fdtbus.c Thu Apr 13 22:27:07 2017 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
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 @@
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;
Home |
Main Index |
Thread Index |
Old Index