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 kernels to link with no console drivers



details:   https://anonhg.NetBSD.org/src/rev/f693ec51f704
branches:  trunk
changeset: 1011920:f693ec51f704
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Jul 16 11:42:17 2020 +0000

description:
Allow kernels to link with no console drivers

diffstat:

 sys/dev/fdt/fdt_subr.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r e4658f2bd33a -r f693ec51f704 sys/dev/fdt/fdt_subr.c
--- a/sys/dev/fdt/fdt_subr.c    Thu Jul 16 11:36:35 2020 +0000
+++ b/sys/dev/fdt/fdt_subr.c    Thu Jul 16 11:42:17 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_subr.c,v 1.36 2020/03/08 08:26:54 skrll Exp $ */
+/* $NetBSD: fdt_subr.c,v 1.37 2020/07/16 11:42:17 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.36 2020/03/08 08:26:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.37 2020/07/16 11:42:17 jmcneill Exp $");
 
 #include "opt_fdt.h"
 
@@ -42,6 +42,7 @@
 
 static struct fdt_conslist fdt_console_list =
     TAILQ_HEAD_INITIALIZER(fdt_console_list);
+FDT_CONSOLE(dummy_console, NULL);
 
 bool
 fdtbus_init(const void *data)
@@ -346,6 +347,8 @@
                int best_match = 0;
 
                __link_set_foreach(info, fdt_consoles) {
+                       if (info == NULL)
+                               continue;
                        const int match = (*info)->ops->match(phandle);
                        if (match > best_match) {
                                best_match = match;



Home | Main Index | Thread Index | Old Index